Fixing the complete reducer to actually create new instance of a todo item

This commit is contained in:
Ken
2019-02-28 09:23:27 -08:00
parent 5e5717240c
commit 2105301c83
8 changed files with 51 additions and 31 deletions

View File

@@ -2,7 +2,7 @@
[Lessons](../) | [Exercise](./exercise/) | [Demo](./demo/)
Theming and Styling with UI Fabric. In this section, we will illustrate how to utilize some of the built-in theming and styling features right inside UI Fabric component library.
Theming and Styling with UI Fabric. In this section, we will illustrate how to utilize some of the built-in theming and styling features right inside UI Fabric component library.
For advanced or non-Fabric component scenarios, UI Fabric also exposes its own CSS-in-JS library called `mergeStyles` that is very performant compared with other similar libraries. A CodePen that illustrates what `mergeStyles` does: https://codepen.io/dzearing/pen/jGdgrE?editors=1011
@@ -16,6 +16,7 @@ These are the areas that we will focus on in this step:
## Fabric Theming and Styling
### 1. Applying Fabric Themes
- Fabric applies themes by propagating the theme down the children through the React Context mechanism
- It is applied with the `<Customizer>` component
- There are some predefined themes within Fabric already, like Fluent (which will become the default in the next major), MDL2, Azure, and some other sample themes like Teams.
@@ -65,9 +66,7 @@ loadTheme({
- You can even use a style function to change the style based on some style prop
- Take a look at these customizations in `demo/src/components/TodoHeader.tsx`
## Advanced / Non-Fabric Component Styling
### 1. CSS-in-JS with mergeStyles
### 4. CSS-in-JS with mergeStyles
- `mergeStyles` is a styling library that creates CSS class from styles that are expressed in JS.
- Fabric uses `mergeStyles` under the hood, so typically you would only directly use `mergeStyles` in niche or non-Fabric scenarios.
@@ -138,4 +137,3 @@ const className = mergeStyles({
```
2. Try to give a few components extra padding