Can anyone tell me the proper way to add css styles with a specific weight to a sub themes .info file? I'd particularly like to know if there is a weight value that will load the css file as the very last one in the after the media query grid css files? For instance, I've added:
css[style-homepage.css][name] = Homepage Styles.
css[style-homepage.css][description] = This file holds the homepage specific css styling.
css[style-homepage.css][options][weight] = 99
to my sub theme .info file, but no matter what weight I give it, it won't load as the last file. Is there a weight number range? Is there any documentation on the default weights for theme css files?
I appreciate any help.
Comments
Comment #1
TelFiRE CreditAttribution: TelFiRE commentedI have run into this issue repeatedly. IMO there is no reason for global.css to be at the very last of the list (obvious exceptions being the specific layout's sheet and any browser conditionals), but it is routinely followed by random module CSS files.
Comment #2
PCateNumbersUSA CreditAttribution: PCateNumbersUSA commentedWould love to hear form an omega dev about this issue, particularly any workaround.
Comment #3
Dubs CreditAttribution: Dubs commentedYes, I would like to know too. At the moment I'm having to override with a more specific CSS rule which isn't ideal.
Comment #4
TelFiRE CreditAttribution: TelFiRE commentedOver-specificity and !importants abound :(
Comment #5
Dubs CreditAttribution: Dubs commentedOK, as @PCateNumbersUSA says, you need to add the CSS declaration in the .info file as follows: -
css[style-homepage.css][name] = Homepage Styles.
css[style-homepage.css][description] = This file holds the homepage specific css styling.
css[style-homepage.css][options][weight] = 99
BUT you also need to enable the CSS in your theme.
Edit your theme's appearance settings, click "Toggle Styles" and enable your new stylesheet.
Comment #6
hosais CreditAttribution: hosais commentedI use omega theme tool to create a subtheme.
I would like to override \profiles\commerce_kickstart\themes\omega_kickstart\css\omega-kickstart-alpha-default.css
I tried to put this css into mytheme_style.css and it does not work at "960px" mode but It would work if I change to "fluid".
I tried to change the wight and it does not work. I of course set "toggle style" thing.
How can I fix this problem?
------------------------------------------------------
For more information:
(If I directly change omega-kickstart-alpha-default.css, it would work.)
(I also observed the html code,
there is no my css file url link in these two sections.
Thanks.
hosais
Comment #7
steinmb CreditAttribution: steinmb as a volunteer commentedConsider this fixed. #6 does look unrelated to CSS load order.