Skip to content

Commit 35a84f2

Browse files
authored
Merge pull request #90 from codeShaurya/master
JSS style guide is added
2 parents bd3314e + c590552 commit 35a84f2

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

css/css_style_guide.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Semantics first
44

5-
Want to make text look big ? Think about the reason first, maybe it is a title and `<h1-6>` should be used. Maybe it is an important word, use `<strong>`. If it is a subtitle, use `body` and `overline` variant. Once the correct semantic is used, you may have a selector ready. Read the full Material Design guideline to design [Typogrrphy](https://material.io/design/typography/the-type-system.html#)
5+
Want to make text look big ? Think about the reason first, maybe it is a title and `<h1-6>` should be used. Maybe it is an important word, use `<strong>`. If it is a subtitle, use `body` and `overline` variant. Once the correct semantic is used, you may have a selector ready. Read the full Material Design guideline to design [Typography](https://material.io/design/typography/the-type-system.html#)
66

77
## Sub-categorize CSS
88

@@ -11,12 +11,16 @@ Want to make text look big ? Think about the reason first, maybe it is a title a
1111
3. Site Category CSS (Consistent visual for a site category (news, weather))
1212
4. Page Specific CSS (used only on 1 page)
1313

14-
By putting the most common CSS in company wide css, you get visual consistency for free, and best code reuse. Alternatively with SASS or LESS, one could declare site-wide variables and import those where required.
14+
By putting the most common CSS in company wide css, you get visual consistency for free, and best code reuse. Alternatively with SASS or LESS, one could declare site-wide variables and import those where required.
1515

1616
* 1 Component, 1 CSS
1717

1818
Can be further extended on individual site categories or pages.
1919

20+
## JSS
21+
22+
One best method to implement subcategorize CSS is to use JSS. JSS stands for Javascript Style sheet. In JSS, CSS is written in a javascript object and then it is parsed by parse in actual css. Write one JSS for one component. Check [official documentation of JSS](https://cssinjs.org/?v=v10.0.0)
23+
2024
## Selectors
2125

2226
Should be as short as possible. Use the element selector only when it makes sense (e.g for site wide styles) . Use descendant, and child selector when the associated markup also follows this hierarchy

0 commit comments

Comments
 (0)