Skip to content

Commit

Permalink
chore(stylelint-badge): create property for forced-colors value to sa…
Browse files Browse the repository at this point in the history
…tisfy lint requirements (#3265)

* chore(stylelint-badge): create property for forced-colors value to satisfy lint requirements

* chore(stylelint-badge): add changeset

* Update components/badge/index.css

Co-authored-by: Stephanie Eckles <thinkdobecreate@gmail.com>

* Update components/badge/index.css

Co-authored-by: Stephanie Eckles <thinkdobecreate@gmail.com>

* chore(stylelint-badge): generate metadata

---------

Co-authored-by: Stephanie Eckles <thinkdobecreate@gmail.com>
  • Loading branch information
cdransf and 5t3ph authored Oct 18, 2024
1 parent b9b910f commit 31fdc3b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/silver-pianos-develop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@spectrum-css/badge": minor
---

Assigns CanvasText to custom property to satisfy linting requirements.
4 changes: 3 additions & 1 deletion components/badge/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
--spectrum-badge-icon-spacing-horizontal: var(--spectrum-component-edge-to-visual-100);
--spectrum-badge-icon-spacing-vertical-top: var(--spectrum-component-top-to-workflow-icon-100);
--spectrum-badge-icon-only-spacing-horizontal: var(--spectrum-component-edge-to-visual-only-100);

--highcontrast-badge-border-color: CanvasText;
}

/* text and icon color is black for these background colors */
Expand Down Expand Up @@ -146,7 +148,7 @@
/* windows high contrast mode */
@media (forced-colors: active) {
.spectrum-Badge {
border-color: CanvasText; /* stylelint-disable-line declaration-property-value-no-unknown */
border-color: var(--highcontrast-badge-border-color);
}
}

Expand Down
2 changes: 1 addition & 1 deletion components/badge/metadata/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,5 +177,5 @@
],
"system-theme": [],
"passthroughs": [],
"high-contrast": []
"high-contrast": ["--highcontrast-badge-border-color"]
}

0 comments on commit 31fdc3b

Please sign in to comment.