Skip to content

Commit a48ad55

Browse files
committed
add File structure section
1 parent 02eabea commit a48ad55

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

CONTRIBUTING.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ This project has a [code of conduct](CODE_OF_CONDUCT.md) that all contributors a
1818
- [Process](#process)
1919
- [Publishing](#publishing)
2020
- [Step 4 breakdown](#step-4-breakdown)
21+
- [File structure](#file-structure)
2122
- [CSS style guide](#css-style-guide)
2223

2324
## Issue tracker
@@ -136,6 +137,21 @@ If you have permission to publish a new version apply the following steps, alway
136137

137138
_Each step will only run if the one before it passed._
138139

140+
## File structure
141+
142+
The source files are grouped by function using the groups defined in MDN's **[HTML elements reference](https://developer.mozilla.org/en-US/docs/Web/HTML/Element)** document.
143+
144+
This makes it easier to find what you're looking for especially when this grouping is commonly used amongst other similar CSS libraries.
145+
146+
There are two groups (files) that are outside of the **HTML elements reference** grouping, these are:
147+
148+
- **[`global.css`](src/global.css)** _which has two usages:_
149+
1. For styles that are applied to everything typically via the universal selector (`*`).
150+
2. For styles that might not be truly global but are still considered "global" enough due to the type of selectors they use, e.g.: `[tabindex='-1']:focus`. Plus, these styles don't fit into any of the other groups.
151+
- **[`grouped.css`](src/grouped.css)** is for grouping selectors from two or more groups that share the same styles where by repeating the styles across multiple files would be detrimental to the maintainability of the library. In short, this file is to keep things DRY.
152+
153+
Please always stick to this structure.
154+
139155
## CSS style guide
140156

141157
The CSS style guide is coming soon, [see](https://github.com/chris-pearce/backpack.css/issues/24).

0 commit comments

Comments
 (0)