You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Colors, spacing, and typography are the building blocks of the design system and
2
-
are often referred to as design tokens. Design tokens are named entities that
3
-
store visual design attributes.
1
+
Colors, spacing, and typography are the building blocks of the design system and are often referred to as design tokens. Design tokens are named entities that store visual design attributes.
and the `theme` object. To ensure consistency, always use values from the
8
-
`theme` object, instead of hardcoded values.
3
+
Those values are accessible in the app via [ThemeProvider](https://github.com/component-driven/component-driven-development/blob/master/src/ThemeProvider.js) and the `theme` object. To ensure consistency, always use values from the `theme` object, instead of hardcoded values.
9
4
10
5
For example:
11
6
@@ -20,9 +15,7 @@ const Message = styled.p`
20
15
`;
21
16
```
22
17
23
-
_Prefer_ the [Text](/#/Primitives?id=text) and
24
-
[Heading](/#/Primitives?id=heading) components to render any text inside the
25
-
app:
18
+
_Prefer_ the [Text](/#/Primitives?id=text) and [Heading](/#/Primitives?id=heading) components to render any text inside the app:
26
19
27
20
```diff
28
21
- const Small = styled.p`
@@ -33,6 +26,4 @@ app:
33
26
+ <Text variant="secondary">Oh dear! Oh dear! I shall be late!</Text>
Check out the [theme.js](https://github.com/component-driven/component-driven-development/blob/master/src/theme.js) file for all available design tokens.
User Interface Design patterns are recurring solutions that solve common design
2
-
problems. Design patterns are standard reference points for the experienced user
3
-
interface designer.
1
+
User Interface Design patterns are recurring solutions that solve common design problems. Design patterns are standard reference points for the experienced user interface designer.
4
2
5
-
With the component-driven approach now we can also encapsulate design solutions
6
-
into code and to deliver consistent user experience much faster!
3
+
With the component-driven approach now we can also encapsulate design solutions into code and to deliver consistent user experience much faster!
7
4
8
-
UI patterns oftentime have a structure that defined the problem, shows examples
9
-
of the solution, and provides guidance on the usage.
5
+
UI patterns oftentime have a structure that defined the problem, shows examples of the solution, and provides guidance on the usage.
10
6
11
7
For the simplcity, in this demo app we have just a few UI patterns.
Copy file name to clipboardExpand all lines: src/components/primitives/Card/Card.md
+2-5
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,6 @@
1
-
Card component is a component that renders an image, a body and a footer with a
2
-
specific layout.
1
+
Card component is a component that renders an image, a body and a footer with a specific layout.
3
2
4
-
By using subcomponents `Card.Cover`, `Card.Body` and `Card.Footer` users can
5
-
create different kinds of card for different use cases, because all
6
-
subcomponents are optional and the card look good with any combination of them.
3
+
By using subcomponents `Card.Cover`, `Card.Body` and `Card.Footer` users can create different kinds of card for different use cases, because all subcomponents are optional and the card look good with any combination of them.
Copy file name to clipboardExpand all lines: src/exercises/1-Introduction/Readme.md
+6-15
Original file line number
Diff line number
Diff line change
@@ -2,28 +2,19 @@ In this exercise we’ll learn basics of React Styleguidist.
2
2
3
3
## 1.1. Exploring React Styleguidist
4
4
5
-
[React Styleguidist](https://react-styleguidist.js.org/) is a tool we’re using
6
-
as a workbench to develop components, and to generate a style guide.
5
+
[React Styleguidist](https://react-styleguidist.js.org/) is a tool we’re using as a workbench to develop components, and to generate a style guide.
7
6
8
7
### The task
9
8
10
-
1. Explore React Styleguidist interface, try to switch to isolated mode (a
11
-
button in the top right corner), try to edit code of the examples in the
12
-
browser.
9
+
1. Explore React Styleguidist interface, try to switch to isolated mode (a button in the top right corner), try to edit code of the examples in the browser.
13
10
14
-
2. Edit examples in the `Button.md` file, add a new example. See how examples in
15
-
the browser update.
11
+
2. Edit examples in the `Button.md` file, add a new example. See how examples in the browser update.
16
12
17
-
3. Edit a component source in the `Button.js` file. See how all examples update
18
-
every time you save a file.
13
+
3. Edit a component source in the `Button.js` file. See how all examples update every time you save a file.
19
14
20
-
4. Edit component’s `PropTypes` definition. See how “Props & methods” section
21
-
reacts to the updates.
15
+
4. Edit component’s `PropTypes` definition. See how “Props & methods” section reacts to the updates.
22
16
23
-
5. Add a new component and an example Markdown file in the
24
-
`src/exercises/1-Introduction` folder (both, `.js` and `.md`, files should
25
-
have the same name) and see how it’s automatically added to the style guide
26
-
(restart the style guide if the new component doesn’t appear).
17
+
5. Add a new component and an example Markdown file in the `src/exercises/1-Introduction` folder (both, `.js` and `.md`, files should have the same name) and see how it’s automatically added to the style guide (restart the style guide if the new component doesn’t appear).
Copy file name to clipboardExpand all lines: src/exercises/2-Design_Tokens/Readme.md
+7-17
Original file line number
Diff line number
Diff line change
@@ -2,27 +2,17 @@ In this exercise we’ll learn basics of React Styleguidist.
2
2
3
3
## 2.1. What are design tokens?
4
4
5
-
Design tokens are the single source of truth for project’s colors, whitespace,
6
-
font styles and other design decisions.
5
+
Design tokens are the single source of truth for project’s colors, whitespace, font styles and other design decisions.
7
6
8
-
We’ve prepared the basic structure for the design tokens file. Open the
9
-
`theme.js` in the exercise directory (`src/exercises/2-Design_Tokens/theme.js`).
7
+
We’ve prepared the basic structure for the design tokens file. Open the `theme.js` in the exercise directory (`src/exercises/2-Design_Tokens/theme.js`).
10
8
11
9
### The task
12
10
13
-
1. Add a few colors to the `theme.js` and see how the style guide going to
14
-
render them.
15
-
1. Add a palette of grey colors to the `colors` object (_hint_: Use `Array` for
16
-
that).
17
-
1. Change spacing scale to see how swatches react to this change. Continue with
0 commit comments