I've leaped into SASS and am loving it. I'm asking for comments here on whether my SASS is well-formatted.
Here's the original CSS based on Zurb's Foundation Pagination styles, but adapted for use with Laravel's built-in pagination:
div.pagination ul { display: block; height: 24px; margin-left: -5px; }
div.pagination ul li { float: left; display: block; height: 24px; color: #999; font-size: 14px; margin-left: 5px; }
div.pagination ul li a { display: block; padding: 1px 7px 1px; color: #555; font-weight: normal}
div.pagination ul li:hover a,
div.pagination li a:focus { background: $bgltblue; }
div.pagination ul li.disabled a { cursor: default; color: #999; }
div.pagination ul li.disabled:hover a,
div.pagination li.disabled a:focus { background: transparent; }
div.pagination ul li.active a { background: $headblue; color: white; font-weight: normal; cursor: default; }
div.pagination ul li.active a:hover,
div.pagination li.active a:focus { background: $headblue; }
Here's my manual conversion to SASS:
div.pagination {
ul {
display: block; height: 24px; margin-left: -5px;
li {
float: left; display: block; height: 24px; color: #999; font-size: 14px; margin-left: 5px;
a {
display: block; padding: 1px 7px 1px; color: #555; font-weight: normal;
}
&:hover a {
background: $bgltblue;
}
&.disabled {
a {
cursor: default; color: #999;
}
&:hover a {
background: transparent;
}
}
&.active {
a {
background: $headblue; color: white; font-weight: normal; cursor: default;
&:hover {
background: $headblue;
}
}
}
}
}
li {
a:focus {
background: $bgltblue;
}
&.disabled {
a:focus {
background: transparent;
}
}
&.active {
a:focus {
background: $headblue;
}
}
}
}
I'd like to know if you think I have reduced it correctly, and where I might make improvements. I plan to replace the colours with var
s already.