Skip to content

Conversation

danrosenthal
Copy link

🎩
screencapture-polaris-myshopify-io-components-structure-theme-provider-2020-02-19-10_04_07

Todo

  • add proper links to new documentation
  • add ability for examples to declaratively opt out of rendering the default app provider @BPScott

@danrosenthal danrosenthal added the 🤖Skip Changelog Causes CI to ignore changelog update check. label Feb 19, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Feb 19, 2020

🟢 No significant changes to src/**/*.tsx were detected.

Copy link
Contributor

@sadiesaurus sadiesaurus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Content looks great, thanks for getting this going so quickly. Some suggested edits and a couple questions.


### Theme provider rendered by the app provider

The app provider component renders a theme provider component and a theme. By default, theme falls back to the current design language. The new design language is enabled by passing `{newDesignLanguage: true}` to the `features` prop on the app provider component.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if we might want to move away from using "current" and "new" when talking about design language. Could this be confusing and will it need to be changed in the future?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like a temporary problem, as this content pretty much goes away when the new design language is the design language. My vote is this stays as-is for now, but I am open to any language that can add some clarity.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point. What if we keep it but change "current" to "old" to be sure that folks don't mistake "current" for "new"?

@amrocha
Copy link
Contributor

amrocha commented Feb 19, 2020

There was a Github outage earlier and some weird race condition on Github's end happened, that's why there's two splash comments above. I went ahead and deleted the stale one, sorry for the confusion friends

@Shopify Shopify deleted a comment from github-actions bot Feb 19, 2020
@danrosenthal danrosenthal force-pushed the theme-provider-docs branch from c90a44a to 12d416c Compare March 4, 2020 14:51
@danrosenthal danrosenthal changed the title [WIP][Color system] add theme provider readme [Color system] add theme provider readme Mar 4, 2020
@danrosenthal
Copy link
Author

This is ready to ship, but we'll need to make sure that the style guide does not wrap these examples in an app provider, as it will break the examples.

@tmlayton tmlayton force-pushed the theme-provider-docs branch from 7be18f8 to 0bc9871 Compare March 7, 2020 03:23
- color scheme
- light mode
- dark mode
omitAppProvider: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the secret sauce for turning off the wrapping AppProvider in Storybook and the Style Guide

@tmlayton tmlayton merged commit d7a99e2 into master Mar 7, 2020
@tmlayton tmlayton deleted the theme-provider-docs branch March 7, 2020 05:00

## Consuming theme colors in a component

The theme provider component uses [CSS custom properties](https://developer.mozilla.org/en-US/docs/Web/CSS/--*) to share color values with components. For a full list of available CSS custom properties, see the [Polaris tokens docs](link/to/polaris/tokens/docs).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticed this link is broken which causes the Style Guide build to fail (link checker)—might require a patch release. For now this can point to https://github.com/Shopify/polaris-react/blob/master/documentation/Color%20system.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖Skip Changelog Causes CI to ignore changelog update check.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants