Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add filter for CSS media type #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add filter for CSS media type #14

wants to merge 1 commit into from

Conversation

mvirenius
Copy link

Could you add filter for CSS media type? It could make easier to exclude default column CSS in specific screen sizes, for example when you are designing responsive theme. Nobody wants to read 100px width columns in their mobile screens.

Example usage of the filter:
add_filter('gc_css_media_type', function(){ return '(min-width:480px)'; });

@justintadlock
Copy link
Owner

Adding an extra hook here seems like unnecessary overhead that can be avoided. WordPress already provides the functionality needed out of the box.

You can do it with functions:

There are also several hooks available:

  • style_loader_tag (best option)
  • print_styles_array
  • style_loader_src

@bluantinoo
Copy link

why not a simple media query in css file?

@media only screen and (max-width: 480px) {
      .column-grid .column{
        width:100%!important;
        margin-left:0!important;
        margin-right:0!important;
    }
}

@Firestorm-Graphics
Copy link

bit hacky dont ya think ?

@bluantinoo
Copy link

For mobiles I don't think. usually any column system or builder makes column 100% width on mobiles.
Do you imagine a better solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants