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
Copy file name to clipboardExpand all lines: readme.md
+11-11Lines changed: 11 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -144,7 +144,7 @@ const themeSpec = {
144
144
145
145
### Create a theme
146
146
147
-
A *theme* is an object relating *theme properties* with *CSS values* (can be arbitrarily nested). It provides a way to define and reference CSS values via *theme property paths*.
147
+
A *theme* is an object relating *theme properties* with *CSS values* (can be arbitrarily nested). It provides a way to define and reference CSS values via *theme values*.
148
148
149
149
Create a theme using a *theme spec* with `createTheme`:
150
150
@@ -216,7 +216,7 @@ Render a *themed style* object with `renderer.renderStyle`:
216
216
217
217
```js
218
218
conststyle= {
219
-
color:'brand.primary', // theme property path informs that the value is theme-driven
219
+
color:'brand.primary', // theme values are authored in JSONPath syntax based on their definitions in the theme.
220
220
fill:'rgba(0, 0, 0, 0.5)', // CSS values are also valid
Creates an object of *CSS variables* using the provided *theme*. CSS variables are named based on the *theme property paths* of the provided theme.
574
+
Creates an object of *CSS variables* using the provided *theme*. CSS variables are named based on the *theme values* defined in the provided theme.
575
575
576
576
##### Parameters
577
577
@@ -911,7 +911,7 @@ const themeSpec = {
911
911
912
912
### Theme
913
913
914
-
-***Theme***: An object relating *theme properties* with *CSS values* (can be arbitrarily nested). Provides a way to define and reference CSS values via *theme property paths*.
914
+
-***Theme***: An object relating *theme properties* with *CSS values* (can be arbitrarily nested). Provides a way to define and reference CSS values via *theme values*.
915
915
<details>
916
916
<summary>Example</summary>
917
917
@@ -923,11 +923,11 @@ const themeSpec = {
923
923
924
924
The `colors` and `spacings` are theme properties based on `theme`.
925
925
</details>
926
-
-***Theme property path***: [JSONPath]-like syntax to refer to *CSS values* in a *theme*.
926
+
-***Theme value***: [JSONPath]-like syntax to refer to *CSS values* in a *theme*.
927
927
<details>
928
928
<summary>Example</summary>
929
929
930
-
The `'colors.brand.primary'` and `'spacings.m'` theme property paths would refer to the CSS values `'blue'` and `8` respectively based on `theme`.
930
+
The `'colors.brand.primary'` and `'spacings.m'` theme values would refer to the CSS values `'blue'` and `8` respectively based on how they are defined in`theme`.
931
931
</details>
932
932
-***Theme spec***: An object relating *theme properties* with *CSS properties*. It is used as a specification together with a *theme* to inform how *themed styles* should be resolved and rendered to CSS.
933
933
<details>
@@ -937,7 +937,7 @@ const themeSpec = {
937
937
- the `colors`*theme property* relates to the `backgroundColor`, `color`*CSS properties*.
938
938
- the `spacings`*theme property* relates to the `margin`, `marginBottom`, `marginLeft`, `marginRight`, `marginTop`*CSS properties*.
939
939
</details>
940
-
-***Themed style***: A *style* that is specified with *theme property paths* as values (instead of *CSS values*). A themed style is only meaningful in relation to a *theme* and *theme spec*, as the following example demonstrates.
940
+
-***Themed style***: A *style* that is specified with *theme values*instead of *CSS values* (CSS values can still be specified). A themed style is only meaningful in relation to a *theme* and *theme spec*, as the following example demonstrates.
941
941
<details>
942
942
<summary>Example</summary>
943
943
@@ -965,11 +965,11 @@ const themeSpec = {
965
965
}
966
966
```
967
967
968
-
-`color` is resolved to the *CSS value*`'blue'` by checking that the `color`*CSS property* is registered in`themeSpec` (under the `colors`*theme property*) and that the `'brand.primary'`*theme property path* is resolvable under `theme.colors`.
969
-
-`margin` is resolved to the *CSS value*`'8px'` by checking that the `margin`*CSS property* is registered in`themeSpec` (under the `spacings`*theme property*) and that the `'m'`*theme property path* is resolvable under `theme.spacings`.
968
+
-`color` is resolved to the *CSS value*`'blue'` by checking that the `color`*CSS property* is registered in`themeSpec` (under the `colors`*theme property*) and that the `'brand.primary'`*theme value* is resolvable under `theme.colors`.
969
+
-`margin` is resolved to the *CSS value*`'8px'` by checking that the `margin`*CSS property* is registered in`themeSpec` (under the `spacings`*theme property*) and that the `'m'`*theme value* is resolvable under `theme.spacings`.
970
970
-`fill` and `top` simply use their specified *CSS values* as fallback values since they cannot be resolved based on the `theme` and `themeSpec`.
971
-
-`backgroundColor` is unresolved because while it is a *CSS property* registered in`themeSpec`, the `'not.a.valid.path'`*theme property path* is not resolvable under `theme.colors`.
972
-
-`padding` is unresolved because it is not a *CSS property* registered in`themeSpec` despite having a valid *theme property path*.
971
+
-`backgroundColor` is unresolved because while it is a *CSS property* registered in`themeSpec`, the `'not.a.valid.path'`*theme value* is not resolvable under `theme.colors`.
972
+
-`padding` is unresolved because it is not a *CSS property* registered in`themeSpec` despite having a valid *theme value*.
973
973
974
974
</details>
975
975
-***Theme renderer***:A program that resolves *themed styles* based on the provided *theme* and *theme spec*, and renders the CSS to DOM.
0 commit comments