Skip to content

Commit

Permalink
Disallow text transform in stylelint-polaris coverage rules (#8244)
Browse files Browse the repository at this point in the history
<!--
  ☝️How to write a good PR title:
- Prefix it with [ComponentName] (if applicable), for example: [Button]
  - Start with a verb, for example: Add, Delete, Improve, Fix…
  - Give as much context as necessary and as little as possible
  - Prefix it with [WIP] while it’s a work in progress
-->

### WHY are these changes introduced?

Fixes #8241 <!-- link to issue if one exists -->

<!--
  Context about the problem that’s being addressed.
-->

### WHAT is this pull request doing?

<!--
  Summary of the changes committed.

Before / after screenshots are appreciated for UI changes. Make sure to
include alt text that describes the screenshot.

If you include an animated gif showing your change, wrapping it in a
details tag is recommended. Gifs usually autoplay, which can cause
accessibility issues for people reviewing your PR:

    <details>
      <summary>Summary of your gif(s)</summary>
      <img src="..." alt="Description of what the gif shows">
    </details>
-->

Adds the `text-transform` to the disallow properties list of the
`stylelint-polaris` plugin.
  • Loading branch information
sam-b-rose authored Feb 2, 2023
1 parent 1b1394d commit 0ee4325
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changeset/metal-queens-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@shopify/stylelint-polaris': minor
'@shopify/polaris': patch
---

Disallow text-transform property in Stylelint Polaris
1 change: 1 addition & 0 deletions polaris-react/src/components/AppProvider/AppProvider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ body {
line-height: var(--p-font-line-height-2);
font-weight: var(--p-font-weight-regular);

// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
text-transform: initial;
letter-spacing: initial;

Expand Down
1 change: 1 addition & 0 deletions polaris-react/src/components/Banner/Banner.scss
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@
font-size: var(--p-font-size-100);
font-weight: var(--p-font-weight-medium);
line-height: var(--p-font-line-height-1);
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
text-transform: initial;
letter-spacing: initial;
color: var(--p-text);
Expand Down
2 changes: 2 additions & 0 deletions polaris-react/src/components/Button/Button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
font-size: var(--p-font-size-100);
font-weight: var(--p-font-weight-medium);
line-height: var(--p-font-line-height-1);
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
text-transform: initial;
letter-spacing: initial;
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
Expand Down Expand Up @@ -463,6 +464,7 @@
font-size: var(--p-font-size-200);
font-weight: var(--p-font-weight-medium);
line-height: var(--p-font-line-height-2);
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
text-transform: initial;
letter-spacing: initial;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
font-size: var(--p-font-size-75);
font-weight: var(--p-font-weight-medium);
line-height: var(--p-font-line-height-1);
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
text-transform: initial;
letter-spacing: initial;
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
Expand Down
1 change: 1 addition & 0 deletions polaris-react/src/components/FooterHelp/FooterHelp.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
font-weight: var(--p-font-weight-regular);
line-height: var(--p-font-line-height-2);
border: none;
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
text-transform: initial;
letter-spacing: initial;
}
1 change: 1 addition & 0 deletions polaris-react/src/components/Frame/Frame.scss
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@
font-size: var(--p-font-size-100);
font-weight: var(--p-font-weight-medium);
line-height: var(--p-font-line-height-1);
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
text-transform: initial;
letter-spacing: initial;
color: var(--p-text);
Expand Down
1 change: 1 addition & 0 deletions polaris-react/src/components/Navigation/Navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ $disabled-fade: 0.6;
}

.SectionHeading {
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
text-transform: none; // Adding this intentionally to override the default subheading styling.
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
display: flex;
Expand Down
1 change: 1 addition & 0 deletions polaris-react/src/components/Select/Select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
font-size: var(--p-font-size-200);
font-weight: var(--p-font-weight-regular);
line-height: var(--p-font-line-height-2);
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
text-transform: initial;
letter-spacing: initial;
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
Expand Down
1 change: 1 addition & 0 deletions polaris-react/src/components/TextField/TextField.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ $spinner-icon-size: 12px;
font-size: var(--p-font-size-200);
font-weight: var(--p-font-weight-regular);
line-height: var(--p-font-line-height-2);
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
text-transform: initial;
letter-spacing: initial;
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
Expand Down
5 changes: 5 additions & 0 deletions polaris-react/src/styles/shared/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
font-size: 13px;
font-weight: var(--p-font-weight-semibold);
line-height: var(--p-font-line-height-1);
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
text-transform: uppercase;

@media #{$p-breakpoints-md-up} {
Expand All @@ -39,6 +40,7 @@
line-height: var(--p-font-line-height-3);
border: none;

// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
text-transform: initial;
letter-spacing: initial;

Expand All @@ -53,6 +55,7 @@
font-weight: var(--p-font-weight-regular);
line-height: var(--p-font-line-height-2);

// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
text-transform: initial;
letter-spacing: initial;

Expand All @@ -67,6 +70,7 @@
font-weight: var(--p-font-weight-medium);
line-height: var(--p-font-line-height-1);

// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
text-transform: initial;
letter-spacing: initial;

Expand All @@ -81,6 +85,7 @@
font-weight: var(--p-font-weight-medium);
line-height: var(--p-font-line-height-2);

// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
text-transform: initial;
letter-spacing: initial;

Expand Down
1 change: 1 addition & 0 deletions stylelint-polaris/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ const stylelintPolarisCoverageOptions = {
'line-height': ['px', 'rem', 'em'],
},
],
'property-disallowed-list': ['text-transform'],
'function-disallowed-list': [
'font-family',
'font-size',
Expand Down

0 comments on commit 0ee4325

Please sign in to comment.