I’ve been thinking of ways I could organise my stylesheets in order for them to be super tidy.
Of course I already break my css into separate sections with comments such as:
/* NAVIGATION
---------------------------------------------*/
However I’d like to go a bit further, particularly if I’m using a single stylesheet which is getting very long.
In order to have sections such as “navigation” that I can collapse and expand in Textmate (or any other code editor) as I need those styles, is it OK to have curly brackets around all these navigation styles? Like media queries.
This is an example of what I mean:
/* NAVIGATION
---------------------------------------------*/
{
.menu {
bottom: 0;
left: 0;
position: absolute; }
#nav {
float: left; }
#nav li {
float: left; }
#nav a {
-webkit-border-top-right-radius: 8px;
-webkit-border-top-left-radius: 8px;
-moz-border-radius-topright: 8px;
-moz-border-radius-topleft: 8px;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
background: #0396CF;
display: block;
font-size: 14px;
margin-right: 5px;
padding: 6px 10px;
text-decoration: none; }
#nav li.current a,
#nav a:hover {
background: #616161; }
#btn_new {
float: left; }
.btn_new_options {
display: none; }
}
I wonder if it’s a good practice or a terrible one. Will it affect performance?
Cheers