John L.
Well-known member
Hi Guys,
As a web designer I've taken to learning more about Sass and how it can make my life a bit easier. It's been a fantastic find for me and I would like to propose this solution to put XenForo in the forefront with designers in mind.
What is SASS/Compass?
Sass is an extension of CSS3, adding nested rules, variables,mixins, selector inheritance, and more. It’s translated to well-formatted, standard CSS using the command line tool or a web-framework plugin.
Source: http://sass-lang.com/
Compass is an open-source CSS authoring framework which uses the Sass stylesheet language to make writing stylesheets powerful and easy.
Source: http://compass-style.org/help/
What's so good about it?
Compass allows you to utilize various Sass features using pre-defined mixins which have been invaluable in saving me time. For those who design you know it can be tedious writing out all the various browser specific selections when adding design elements. For example, when you want to add rounded corners to an element, you will usually have to write out the following:
Well, that's not cool. What Sass and Compass mixins allow you to do is write this out with much less pain:
This will write out the exact same as above...with far less initial markup. This is of course a small sample of what it can do, but I think having it integrated into the XenForo template and style properies system will help in many ways (not only with Mike and Kier, but theme builders).
Another helpful example is the above mentioned "nesting rules". It gets annoying have to write over and over these specific selectors for elements. Well, skip that now. Instead of having to write:
You can simply write:
It looks a bit more messy without indents, but indented it's much easier to read and find your code. It also helps keep you in check from being too specific with your CSS markup as you never want to go more than 3-levels deep in nesting.
How do we integrate this into XenForo?
Sass and Compass are actually built in Ruby, but there are some PHP versions in development. I'm trying to find some, since it wouldn't be right to require people to install Ruby on their servers to use this. If I find new links to help I will.
As a web designer I've taken to learning more about Sass and how it can make my life a bit easier. It's been a fantastic find for me and I would like to propose this solution to put XenForo in the forefront with designers in mind.
What is SASS/Compass?
Sass is an extension of CSS3, adding nested rules, variables,mixins, selector inheritance, and more. It’s translated to well-formatted, standard CSS using the command line tool or a web-framework plugin.
Source: http://sass-lang.com/
Compass is an open-source CSS authoring framework which uses the Sass stylesheet language to make writing stylesheets powerful and easy.
Source: http://compass-style.org/help/
What's so good about it?
Compass allows you to utilize various Sass features using pre-defined mixins which have been invaluable in saving me time. For those who design you know it can be tedious writing out all the various browser specific selections when adding design elements. For example, when you want to add rounded corners to an element, you will usually have to write out the following:
Code:
.element{-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;}
Code:
.element{@include border-top-radius(5px);}
Another helpful example is the above mentioned "nesting rules". It gets annoying have to write over and over these specific selectors for elements. Well, skip that now. Instead of having to write:
Code:
.element{border:1px solid red;}
.element h2{padding-top:0;}
.element h2 span{color:green;}
Code:
.element
{
border: 1px solid red;
h2 {
padding-top:0;
span {
color:green;
}
}
}
How do we integrate this into XenForo?
Sass and Compass are actually built in Ruby, but there are some PHP versions in development. I'm trying to find some, since it wouldn't be right to require people to install Ruby on their servers to use this. If I find new links to help I will.
Last edited:
Upvote
14