[theme-reviewers] Using wp_enqueue_style() With IE Conditionals

Curtis McHale curtis at curtismchale.ca
Thu Apr 21 21:59:30 UTC 2011


Funny on personal projects I put my stylesheet after wp_head so I can
override the enqueued stylesheets for plugins that don't let you turn them
off or are way over qualified and make it hard to write CSS rules that kill
them. I know it's not best practice but it's way easier than fighting plugin
CSS all day.

Curtis McHale
PH: 604.751.3482
http://www.curtismchale.ca
Linkedin: http://www.linkedin.com/in/curtismchale
Twitter: twitter.com/curtismchale



On Thu, Apr 21, 2011 at 2:53 PM, Chip Bennett <chip at chipbennett.net> wrote:

> I consider that to be by design, that the primary stylesheet, i.e.
> style.css, is hard-coded into the document head. That way, it's easier to
> override with enqueued stylesheets.
>
> Chip
>
> On Thu, Apr 21, 2011 at 4:37 PM, Otto <otto at ottodestruct.com> wrote:
>
>> If you're going to require wp_enqueue_style for CSS files, then you
>> might want to provide some good examples of how to do that for things
>> like the normal style.css file and such, since the vast majority of
>> themes do not use the enqueue for normal styling.
>>
>> -Otto
>>
>>
>>
>> On Fri, Apr 22, 2011 at 4:11 PM, Justin Tadlock
>> <justin at justintadlock.com> wrote:
>> > That's fine by me.
>> >
>> > I thought we already had wp_enqueue_style() and wp_enqueue_script() in
>> the
>> > guidelines.  Now, I see that it was just a reference to the comment
>> reply
>> > script.
>> >
>> > On 4/21/2011 1:50 PM, Edward Caissie wrote:
>> >
>> > I agree with "recommended" for adding additional stylesheets via
>> > wp_enqueue_style() immediately and pushing it to required with 3.2;
>> which
>> > seems will not be all that far off.
>> >
>> > I would also think that example, or similar ones, should be linked to so
>> > authors have something to work from if/when they adapt this "new"
>> method.
>> >
>> >
>> > Cais.
>> >
>> > On Thu, Apr 21, 2011 at 2:39 PM, Chip Bennett <chip at chipbennett.net>
>> wrote:
>> >>
>> >> I agree - but we rarely take something from a non-suggestion to
>> *required*
>> >> in one step, unless a critical need exists.
>> >> The general path is to make something *recommended*, fit-test it for a
>> >> while, and then bump it up to *required*.
>> >> Chip
>> >>
>> >> On Fri, Apr 22, 2011 at 1:27 PM, Justin Tadlock <
>> justin at justintadlock.com>
>> >> wrote:
>> >>>
>> >>> This should be the *required* way.  Additional stylesheets should
>> always
>> >>> be added with wp_enqueue_style().  This is what I've been putting in
>> my
>> >>> reviews, even for conditional stylesheets.
>> >>>
>> >>> On 4/21/2011 1:22 PM, Chip Bennett wrote:
>> >>>
>> >>> I just found this:
>> >>>
>> >>>
>> http://iamzed.com/2010/01/07/using-wordpress-wp_enqueue_style-with-conditionals/
>> >>>
>> >>> wp_enqueue_style(
>> >>>    'ie7-style',
>> >>>    get_template_directory_uri() . '/ie7.css'
>> >>> );
>> >>> global $wp_styles;
>> >>> $wp_styles->add_data( 'ie7-style', 'conditional', 'lte IE 7′);
>> >>>
>> >>> This might move into the Guidelines, as *Recommended* implementation
>> of
>> >>> enqueueing IE-conditional stylesheets. Thoughts?
>> >>> Chip
>> >>>
>> >>> _______________________________________________
>> >>> theme-reviewers mailing list
>> >>> theme-reviewers at lists.wordpress.org
>> >>> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>> >>>
>> >>> _______________________________________________
>> >>> theme-reviewers mailing list
>> >>> theme-reviewers at lists.wordpress.org
>> >>> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>> >>>
>> >>
>> >>
>> >> _______________________________________________
>> >> theme-reviewers mailing list
>> >> theme-reviewers at lists.wordpress.org
>> >> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>> >>
>> >
>> >
>> > _______________________________________________
>> > theme-reviewers mailing list
>> > theme-reviewers at lists.wordpress.org
>> > http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>> >
>> > _______________________________________________
>> > theme-reviewers mailing list
>> > theme-reviewers at lists.wordpress.org
>> > http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>> >
>> >
>> _______________________________________________
>> theme-reviewers mailing list
>> theme-reviewers at lists.wordpress.org
>> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>>
>
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20110421/79b364d5/attachment-0001.htm>


More information about the theme-reviewers mailing list