Skip to content

Commit beb97af

Browse files
Vince SurianiVince Suriani
authored andcommitted
tb specific rules
1 parent a93d00e commit beb97af

File tree

2 files changed

+86
-0
lines changed

2 files changed

+86
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

README.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
- [Variables](#variables)
2020
- [Mixins](#mixins)
2121
- [Nested selectors](#nested-selectors)
22+
- [File Structure](#file-structure)
23+
- [Responsive SCSS](#responsive-scss)
2224

2325
## Terminology
2426

@@ -223,3 +225,87 @@ Again: **never nest ID selectors!**
223225

224226
If you must use an ID selector in the first place (and you should really try not to), they should never be nested. If you find yourself doing this, you need to revisit your markup, or figure out why such strong specificity is needed. If you are writing well formed HTML and CSS, you should **never** need to do this.
225227

228+
229+
###File Structure
230+
231+
We prefer to break up our .sass across multiple specifically named files
232+
233+
``` ruby
234+
|--scss/
235+
|--modules/
236+
|--pages/
237+
|--partials/
238+
|--main.scss
239+
```
240+
241+
* **modules** - functions and mixins and variables. Things that are included into other SCSS files.
242+
* **pages** - one .scss file per page - generally only specific to *that* page. (i.e. home.scss, about.scss, gallery.scss, etc..) Essentially the structure of the site.
243+
* **partials** - things that are considered part of the site's *skin* - i.e. buttons, inputs, media. These are reusable throughout the site.
244+
245+
246+
###Responsive SCSS
247+
248+
We generally prefer to have each element/rule to have it's own responsive rule rather than blocks for each size. This might seem counter-intuitive, but makes for easier editing.
249+
250+
**Bad**
251+
252+
```scss
253+
.avatar{
254+
border-radius:50%;
255+
border:2px solid white;
256+
}
257+
.images {
258+
border: 5px;
259+
width:50%;
260+
display: inline-block;
261+
}
262+
#page {
263+
padding: 10px;
264+
}
265+
266+
@media #{$xlarge-up} {
267+
.avatar{
268+
border-radius:0;
269+
border:0;
270+
}
271+
.images {
272+
width:100%;
273+
display: block;
274+
}
275+
#page {
276+
padding: 20px;
277+
}
278+
}
279+
280+
```
281+
282+
**Good**
283+
284+
```css
285+
.avatar{
286+
border-radius:50%;
287+
border:2px solid white;
288+
289+
@media #{$xlarge-up} {
290+
border-radius:0;
291+
border:0;
292+
}
293+
}
294+
.images {
295+
border: 5px;
296+
width:50%;
297+
display: inline-block;
298+
299+
@media #{$xlarge-up} {
300+
width:100%;
301+
display: block;
302+
}
303+
}
304+
#page {
305+
padding: 10px;
306+
307+
@media #{$xlarge-up} {
308+
padding: 20px;
309+
}
310+
}
311+
```

0 commit comments

Comments
 (0)