diff --git a/CHANGELOG.md b/CHANGELOG.md index d6748315b0..78c81cc1f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ### Documentation - Add `Theming` guide @almedint, @levithomason ([#152](https://github.com/stardust-ui/react/pull/152)) +- Update `Theming` guide @levithomason ([#274](https://github.com/stardust-ui/react/pull/274)) ## [v0.6.0](https://github.com/stardust-ui/react/tree/v0.6.0) (2018-09-24) diff --git a/docs/src/views/Theming.tsx b/docs/src/views/Theming.tsx index 6a973c04d3..f7a2279751 100644 --- a/docs/src/views/Theming.tsx +++ b/docs/src/views/Theming.tsx @@ -12,8 +12,7 @@ export default () => (

Stardust is a fully themable component library. Theming is opt-in, allowing you to theme as much or as little as needed. Themes can be applied to your entire app, to specific subtrees, - or to individual components. You can also infinitely nest and override themes by modifying the - needed variables or styles. + or to individual components. You can also infinitely nest and override themes.

Let's look at how this is done.

@@ -23,7 +22,7 @@ export default () => ( The recommended API for customizing the look and feel of components is through theme variables. Variables are both easier to use and more robust than styles. Setting a theme variable will ensure your value is properly applied to every applicable style in every - supported permutation. + supported usage of the component.

Variables are defined at two levels, the site level and the component level.

@@ -58,11 +57,11 @@ export default () => (

- Component variables are theme values specific to each component. This includes information + Component variables define theme values for a specific component. This includes information such as colors, borders, or box model values.

-

You can define variables on a single component instance.

+

You can define component variables on a single instance of a component.

`, @@ -77,8 +76,8 @@ export default () => ( />

- You can also define variables for all components in a tree using the{' '} - Provider. + You can also define component variables for all components in a part of your render tree using + the Provider.

( )} />

- You can customize all components in your app by defining component variables on a Provider at - the root of your app. + You can customize component variables for your entire app by defining component variables on a{' '} + Provider at the root of your app.

@@ -121,42 +120,92 @@ export default () => (

- All Stardust components explicitly define named parts which make up the component's anatomy. - Example, the Button anatomy defines an icon part. + Styles are available as an escape hatch for when there is no suitable theme variable available + for your needs. Component styles are CSS-like style objects that are converted to + real CSS and applied to your component as HTML class names.

-

Styles can be applied to components and their child parts.

- {' '} - You can style the icon part of a Button component. + You can define styles on a single component instance. +

+ This is green text`} + render={() => This is green text} + /> +

+ Every slot (named part) of every component also accepts styles that are applied + to the root element of the slot.

- `, ].join('\n')} render={() => ( -