Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: design-system-provider now paints CSS color and background color #3278

Merged
merged 8 commits into from
Jun 11, 2020

Conversation

nicholasrice
Copy link
Contributor

@nicholasrice nicholasrice commented Jun 11, 2020

Description

This PR adds a new default behavior to the Design System Provider. By default, when a background color is set on the Design System Provider, the provider will add a stylesheet that sets the background color and color CSS properties. This helps ensure that elements rendering inside the provider are styled appropriately.

The behavior can be turned off with the no-paint attribute (open to other suggestions on the name of this attribute).

Motivation & context

related to #3213

Issue type checklist

  • Chore: A change that does not impact distributed packages.
  • Bug fix: A change that fixes an issue, link to the issue above.
  • New feature: A change that adds functionality.

Is this a breaking change?

  • This change causes current functionality to break.

Adding or modifying component(s) in @microsoft/fast-components checklist

Process & policy checklist

  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

Copy link
Contributor

@EisenbergEffect EisenbergEffect left a comment

Choose a reason for hiding this comment

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

Can we add this to the style docs and remove the inline style instructions?

public noPaint = false;
private noPaintChanged() {
if (!this.noPaint && this.backgroundColor !== void 0) {
this.$fastController.addStyles(backgroundStyles);
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice 👍

@nicholasrice
Copy link
Contributor Author

Oops yes - thanks for the reminder.

@nicholasrice nicholasrice force-pushed the users/nirice/add-background-and-color-to-DSP branch from 46d73cb to bacf742 Compare June 11, 2020 15:14
@nicholasrice nicholasrice merged commit 8e97ac4 into master Jun 11, 2020
@nicholasrice nicholasrice deleted the users/nirice/add-background-and-color-to-DSP branch June 11, 2020 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants