Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Template Questions /

Change priority order of CSS in Requirements::themedCSS


Reply


3 Posts   2924 Views

Avatar
Aaron Brockhurst

Community Member, 30 Posts

30 May 2009 at 11:11am

Hi

Does anyone know if it's possible to change the order that the CSS are listed when SilverStripe builds the page.

In the current version 2.3.1 the CSS in Requirements::themedCSS() statements are compiled after my custom CSS in the template. Is there a way to change the order so that the required css are compiled and then my custom css in the template?

Thanks in advance

Aaron

Avatar
Carbon Crayon

Community Member, 598 Posts

3 June 2009 at 9:09pm

Hi Aaron

Have you tried using the Requirements::customCSS() I think that adds it in after the other requirements.

There is also a bug in the current (and upcoming 2.3.2) versions which means that requirements are added at the end of the head section, even when you have conditional includes for IE6 etc. There is a discussion about this here:
http://groups.google.com.au/group/silverstripe-dev/browse_thread/thread/b8bd6dd5ede2f84f

There is also a patch available attached to this ticket: http://open.silverstripe.com/ticket/3497 though not sure it is for the current version based on will's last comment in the ticket.

Hope that helps

Aram

Avatar
Aaron Brockhurst

Community Member, 30 Posts

3 June 2009 at 9:19pm

Hi Aram

Thanks for the info, I'll take a look at the two links and see if they help.

What we need is to be able to overwrite any module css with a custom one which we can then switch based on the browser using something like this http://www.silverstripe.org/archive/show/58061#post60072

We're working on it this week so I'll post back any solutions here

Thanks