Skip to content

Commit

Permalink
Merge pull request #8 from betterplace/add_basic_documentation
Browse files Browse the repository at this point in the history
Add basic engineering documentation
  • Loading branch information
katrinundfritz authored Jun 21, 2022
2 parents 0fbe0e3 + 244a5d2 commit 83a8c6e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .storybook/order.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
["Tone and Voice", "Accessible and Inclusive Language", "Grammar", "Vocabulary"],
"Design",
["Logo", "Colors", "Typography", "Illustrations", "Icons", "Images"],
"Development",
["Engineering Rules", "Breakpoints"],
"Accessibility",
["Accessibility"],
"Design Tokens",
Expand Down
7 changes: 7 additions & 0 deletions src/stories/Development/breakpoints.stories.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Meta } from '@storybook/addon-docs'

<Meta title="Development/Breakpoints" />

# Breakpoints

Currently we use only 1 breakpoint. We distinguish between phone (0 - 450px) and desktop (451px +). Maybe we want to introduce more breakpoints in the future.
24 changes: 24 additions & 0 deletions src/stories/Development/engineering_rules.stories.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Meta } from '@storybook/addon-docs'

<Meta title="Development/Engineering Rules" />

# Engineering rules (!!!WIP!!!)

#### How do we write our custom components?

- We use CSS Modules.
- We do not use Sass/SCSS for the Design System
- because we don’t need it for variables and nesting anymore. PostCSS allows us to do nesting.
- because it will reduce bundle sizes.
- because we want to have so many dependencies.
- We don't use a CSS Framework, we build our own

### CSS class splitting

CSS classes must always be written in one piece, as well in Slim as in JS.

- bad: `label-${success ? 'success' : 'error'}`
- good: `success ? 'label-success' : 'label-error'`
- bad: [https://css-tricks.com/the-sass-ampersand/#article-header-id-10](https://css-tricks.com/the-sass-ampersand/#article-header-id-10)

This helps to find all occurrences of classes while developing and, more importantly, [PurgeCSS](https://purgecss.com/) can detect used classes and purge the correct classes.

0 comments on commit 83a8c6e

Please sign in to comment.