Best Practices - CSS Theming

后端 未结 5 934

Quite often when I design a website for a customer, I design his website with one (or multiple) CSS files that makes up the entire presentation layer. The thing is, usually, the

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-30 11:55

    In situations where a theme is required I, personally, tend to use three base-stylesheets:

    • A reset stylesheet (typically Eric Meyer's)
    • A stylesheet for positioning of elements (margins, paddings, floats, etc)
    • Typography and colours

    There is an awful lot of repetition in this approach, though, so @treefrog's answer may well be a better approach. The one saving grace I can offer for my approach, which is why it works well for me, is that it's easy to know where to go to change the title font from Arial to Times New Roman (or whatever), and where to find the background-colours for the page. Typically these are stored in a Wordpress-like arrangement:

    http://www.example.com/css/reset.css http://www.example.com/css/themeName/typography.css http://www.example.com/css/themeName/layout.css

提交回复
热议问题