Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS Modular CSS with Sass Sass Grid System Building the Grid Container

Semantic Grid Layout

I have been trying to make the grid layout semantic so that I do not have to use class names like .grid__col--2 in the html markup. I have tried @include .grid__col--2 but this does not work. Help would be appreciated muchly.

Code below...

http://codepen.io/summers1981/pen/JdZGom?editors=110

3 Answers

First up, it would be .grid__col--2 (two underscores between grid and col in the class name), but you can only include mixins, etc.

If you want to use the same styles as an existing rule in the SASS, use extend.

Here's another article that explains the concept well: The Extend Concept

Or if you want to use a framework of some sort, do a search for 'semantic framework'. There's tons of them, and surely one that would suit your needs.

Why not use twitters bootstrap? http://getbootstrap.com

Thanks Guys. I played about with this last night and created @mixins that now work for this.

C

Don't forget to mark an answer as 'Best Answer' to effectively close off this question.