mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Css coding conventions for CMS
This commit is contained in:
parent
51eb70781b
commit
6e99e187b4
@ -441,3 +441,8 @@ See [security](/topics/security) for conventions related to handing security per
|
||||
|
||||
Parts of these coding conventions were adapted from [Zend Framework](http://framework.zend.com/manual/en/coding-standard.overview.html),
|
||||
which are licensed under BSD (see [license](http://framework.zend.com/license)).
|
||||
|
||||
## Related
|
||||
|
||||
* [Topics: CSS](/topics/css)
|
||||
* [Reference: CMS Architecture](/reference/cms-archirecture)
|
@ -37,6 +37,7 @@ plain CSS without SCSS for your custom CMS interfaces as well, we just mandate S
|
||||
|
||||
As there's a whole lot of CSS driving the CMS, we have certain best practives around writing it:
|
||||
|
||||
* Use dashed lowercase naming for both `id` and `class` attributes (`my-class-name`), instead of camel case (`myClassName`)
|
||||
* Use the `id` attribute sparingly. Remember that it "closes off" the structure to code reuse, as HTML elements
|
||||
require unique `id` attributes. Code reuse can happen both in CSS and JavaScript behaviour.
|
||||
* Separate presentation from structure in class names, e.g. `left-menu` is encoding the component position
|
||||
|
Loading…
Reference in New Issue
Block a user