@@ -43,13 +43,10 @@ readability.
43
43
* _ Never_ mix spaces and tabs for indentation.
44
44
* Use soft indents (spaces).
45
45
* Use 2 spaces per indentation level.
46
+ * Use 3 line breaks before an L1 comment block ("===")
47
+ * Use 2 line breaks before an L2 comment block ("---")
48
+ * Remove trailing end-of-line whitespace
46
49
47
- Tip: configure your editor to "show invisibles" or to automatically remove
48
- end-of-line whitespace.
49
-
50
- Tip: use an [ EditorConfig] ( http://editorconfig.org/ ) file (or equivalent) to
51
- help maintain the basic whitespace conventions that have been agreed for your
52
- code-base.
53
50
54
51
55
52
<a name =" comments " ></a >
@@ -102,7 +99,7 @@ Example:
102
99
103
100
/* This will be left in by the sass compiler */
104
101
105
- $myVar: 5px; // use inline comments sparingly ( 2 space indent)
102
+ $myVar: 5px; // Use inline comments sparingly and with 2 space indent
106
103
107
104
```
108
105
@@ -119,7 +116,7 @@ in useful diffs and blames.
119
116
* Include one declaration per line in a declaration block.
120
117
* Use one level of indentation for each declaration.
121
118
* Include a single space after the colon of a declaration.
122
- * Use lowercase and shorthand hex values, e.g., ` #aaa ` .
119
+ * Use uppercase and shorthand hex values, e.g ., `#FFF ` .
123
120
* Use double quotes consistently.
124
121
* Quote attribute values in selectors, e.g ., `input [type = " checkbox" ]`.
125
122
* _Where allowed_, avoid specifying units for zero-values , e.g ., `margin: 0`.
@@ -137,12 +134,12 @@ in useful diffs and blames.
137
134
.selector-3 [type = " text" ] {
138
135
-moz-box-sizing : border-box ;
139
136
-webkit-box-sizing : border-box ;
140
- background : #fff ;
141
- background : linear-gradient (#fff , rgba (0 , 0 , 0 , 0.8 ));
137
+ background : #FFF ;
138
+ background : linear-gradient (#FFF , rgba (0 , 0 , 0 , 0.8 ));
142
139
box-sizing : border-box ;
143
140
color : #333 ;
144
141
display : block ;
145
- font-family : helvetica , arial , sans-serif ;
142
+ font-family : " Helvetica Neue " , Helvetica , Arial , Sans-Serif ;
146
143
}
147
144
148
145
.selector-a ,
@@ -177,8 +174,8 @@ Long declaration should be ordered alphabetically within clusters.
177
174
178
175
/* Other */
179
176
background : #000 ;
180
- color : #fff ;
181
- font-family : sans-serif ;
177
+ color : #FFF ;
178
+ font-family : Sans-Serif ;
182
179
font-size : 16px ;
183
180
text-align : right ;
184
181
}
@@ -205,19 +202,17 @@ be used; one example is shown below.
205
202
``` css
206
203
.selector {
207
204
background-image :
208
- linear-gradient (#fff , #ccc ),
209
- linear-gradient (#f3c , #4ec );
205
+ linear-gradient (#FFF , #CCC ),
206
+ linear-gradient (#F3C , #4EC );
210
207
box-shadow :
211
208
1px 1px 1px #000 ,
212
- 2px 2px 1px 1px #ccc inset ;
209
+ 2px 2px 1px 1px #CCC inset ;
213
210
}
214
211
```
215
212
216
- ### Preprocessors : additional format considerations
213
+ ### SCSS : additional format considerations
217
214
218
- Different CSS preprocessors have different features, functionality, and syntax.
219
- Your conventions should be extended to accommodate the particularities of any
220
- preprocessor in use. The following guidelines are in reference to Sass.
215
+ The following guidelines are in reference to MUI Sass.
221
216
222
217
* Limit nesting to 2 level deep. Reassess any nesting more than 2 levels deep.
223
218
This prevents overly-specific CSS selectors.
@@ -231,13 +226,25 @@ preprocessor in use. The following guidelines are in reference to Sass.
231
226
* Consider prefixing custom functions with ` x- ` or another namespace. This
232
227
helps to avoid any potential to confuse your function with a native CSS
233
228
function, or to clash with functions from libraries.
229
+ * Consider prefixing custom module-level variables with ` x ` or another
230
+ namespace. This helps to avoid any potential to confuse your variable with
231
+ other global variables.
232
+ * Use camelCase syntax for internal variables.
233
+ * Use hyphenated-function-names for SASS functions.
234
+ * Use $mui-hyphenated-variable-name for variables that are exposed to
235
+ end users.
236
+ * Use mui-hyphenated-function-name for SASS functions that are exposed to
237
+ end users.
234
238
235
239
``` scss
236
240
.selector-1 {
237
241
@extend .other-rule ;
238
242
@include clearfix ();
239
243
@include box-sizing (border-box );
240
244
width : x-grid-unit (1 );
245
+ height : xCellHeight;
246
+ color : mui-color (' red' , ' 500' );
247
+ line-height : $mui-base-line-height ;
241
248
// other declarations
242
249
}
243
250
```
0 commit comments