Skip to content

Commit 66eee26

Browse files
committed
Update README.md
1 parent d6a7a44 commit 66eee26

File tree

1 file changed

+27
-20
lines changed

1 file changed

+27
-20
lines changed

README.md

+27-20
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,10 @@ readability.
4343
* _Never_ mix spaces and tabs for indentation.
4444
* Use soft indents (spaces).
4545
* 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
4649

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.
5350

5451

5552
<a name="comments"></a>
@@ -102,7 +99,7 @@ Example:
10299

103100
/* This will be left in by the sass compiler */
104101

105-
$myVar: 5px; // use inline comments sparingly (2 space indent)
102+
$myVar: 5px; // Use inline comments sparingly and with 2 space indent
106103

107104
```
108105

@@ -119,7 +116,7 @@ in useful diffs and blames.
119116
* Include one declaration per line in a declaration block.
120117
* Use one level of indentation for each declaration.
121118
* 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`.
123120
* Use double quotes consistently.
124121
* Quote attribute values in selectors, e.g., `input[type="checkbox"]`.
125122
* _Where allowed_, avoid specifying units for zero-values, e.g., `margin: 0`.
@@ -137,12 +134,12 @@ in useful diffs and blames.
137134
.selector-3[type="text"] {
138135
-moz-box-sizing: border-box;
139136
-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));
142139
box-sizing: border-box;
143140
color: #333;
144141
display: block;
145-
font-family: helvetica, arial, sans-serif;
142+
font-family: "Helvetica Neue", Helvetica, Arial, Sans-Serif;
146143
}
147144

148145
.selector-a,
@@ -177,8 +174,8 @@ Long declaration should be ordered alphabetically within clusters.
177174

178175
/* Other */
179176
background: #000;
180-
color: #fff;
181-
font-family: sans-serif;
177+
color: #FFF;
178+
font-family: Sans-Serif;
182179
font-size: 16px;
183180
text-align: right;
184181
}
@@ -205,19 +202,17 @@ be used; one example is shown below.
205202
```css
206203
.selector {
207204
background-image:
208-
linear-gradient(#fff, #ccc),
209-
linear-gradient(#f3c, #4ec);
205+
linear-gradient(#FFF, #CCC),
206+
linear-gradient(#F3C, #4EC);
210207
box-shadow:
211208
1px 1px 1px #000,
212-
2px 2px 1px 1px #ccc inset;
209+
2px 2px 1px 1px #CCC inset;
213210
}
214211
```
215212

216-
### Preprocessors: additional format considerations
213+
### SCSS: additional format considerations
217214

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.
221216

222217
* Limit nesting to 2 level deep. Reassess any nesting more than 2 levels deep.
223218
This prevents overly-specific CSS selectors.
@@ -231,13 +226,25 @@ preprocessor in use. The following guidelines are in reference to Sass.
231226
* Consider prefixing custom functions with `x-` or another namespace. This
232227
helps to avoid any potential to confuse your function with a native CSS
233228
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.
234238

235239
```scss
236240
.selector-1 {
237241
@extend .other-rule;
238242
@include clearfix();
239243
@include box-sizing(border-box);
240244
width: x-grid-unit(1);
245+
height: xCellHeight;
246+
color: mui-color('red', '500');
247+
line-height: $mui-base-line-height;
241248
// other declarations
242249
}
243250
```

0 commit comments

Comments
 (0)