Skip to content

Commit

Permalink
fix(sx): support Primer colors for border*Color properties (#3619)
Browse files Browse the repository at this point in the history
* fix(sx): support Primer colors for `border*Color` properties

* build: add changeset
  • Loading branch information
gr2m authored Aug 15, 2023
1 parent b26be06 commit d4ae582
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .changeset/angry-boats-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@primer/react': patch
---

Include `border*Color` properties in sx to support named Primer colors

<!-- Changed components: _none_ -->
4 changes: 3 additions & 1 deletion src/sx.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import css, {SystemCssProperties, SystemStyleObject} from '@styled-system/css'
import {ThemeColorPaths, ThemeShadowPaths} from './theme'
import {ColorProps, ShadowProps} from 'styled-system'
import {ColorProps, BorderColorProps, ShadowProps} from 'styled-system'
import merge from 'deepmerge'

export type BetterCssProperties = {
[K in keyof SystemCssProperties]: K extends keyof ColorProps
? ThemeColorPaths | SystemCssProperties[K]
: K extends keyof BorderColorProps
? ThemeColorPaths | SystemCssProperties[K]
: K extends keyof ShadowProps
? ThemeShadowPaths | SystemCssProperties[K]
Expand Down

0 comments on commit d4ae582

Please sign in to comment.