Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Cascading Style sheets, themes, media and alternative style sheets

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1 2
Go to End
Author Topic: 3996 Views
  • KatB
    Avatar
    Community Member
    94 Posts

    Re: Cascading Style sheets, themes, media and alternative style sheets Link to this post

    What is the smartest way to include a special style sheet that is only in existence for one page and is quite large?

    I have tried to over-ride the init function for that page type in its controller:

    class Widget_Controller extends Page_Controller {

    function init() {
    parent::init();
    Requirements::themedCSS("widgets.css");
    }
    }

    but to no avail. Should this work?

  • DesignCity
    Avatar
    38 Posts

    Re: Cascading Style sheets, themes, media and alternative style sheets Link to this post

    willr: I don't use it often but I have used it before. Adding a title to a css sheet enables you to have alternative style sheets set up in the document that have to be 'selected'. This lets you do reasonably useless things like switching themes, and reasonably useful things like having alternative high contrast stylesheet for users with impaired vision, or an alternative stylesheet with a larger font size etc.

    We use them on our corporate site (http://designcity.com.au/) to increase the font size.

    3996 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.