Skip to content

Commit 5fd6d84

Browse files
committed
docs: rename "theme-property path" to "theme value"
1 parent d3d87d6 commit 5fd6d84

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

readme.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ const themeSpec = {
144144

145145
### Create a theme
146146

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*.
148148

149149
Create a theme using a *theme spec* with `createTheme`:
150150

@@ -216,7 +216,7 @@ Render a *themed style* object with `renderer.renderStyle`:
216216

217217
```js
218218
const style = {
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.
220220
fill: 'rgba(0, 0, 0, 0.5)', // CSS values are also valid
221221
padding: 'm',
222222
':hover': {
@@ -571,7 +571,7 @@ const combinedStyleRule = props => ({
571571

572572
### `createCssVariables(theme?, options?) => cssVariables`
573573

574-
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.
575575

576576
##### Parameters
577577

@@ -911,7 +911,7 @@ const themeSpec = {
911911

912912
### Theme
913913

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*.
915915
<details>
916916
<summary>Example</summary>
917917

@@ -923,11 +923,11 @@ const themeSpec = {
923923

924924
The `colors` and `spacings` are theme properties based on `theme`.
925925
</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*.
927927
<details>
928928
<summary>Example</summary>
929929

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`.
931931
</details>
932932
- ***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.
933933
<details>
@@ -937,7 +937,7 @@ const themeSpec = {
937937
- the `colors` *theme property* relates to the `backgroundColor`, `color` *CSS properties*.
938938
- the `spacings` *theme property* relates to the `margin`, `marginBottom`, `marginLeft`, `marginRight`, `marginTop` *CSS properties*.
939939
</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.
941941
<details>
942942
<summary>Example</summary>
943943

@@ -965,11 +965,11 @@ const themeSpec = {
965965
}
966966
```
967967

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`.
970970
- `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*.
973973

974974
</details>
975975
- ***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

Comments
 (0)