This repository has been archived by the owner on Jun 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Consistently define mixins as objects
This prevents interpolation errors caused by spreading the output of a styled-components `css` function into a CSS object
- Loading branch information
1 parent
c0867c8
commit 4ce9be0
Showing
10 changed files
with
45 additions
and
98 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import {alpha} from '../utils/colors'; | ||
|
||
function borderValue(theme) { | ||
return `1px solid ${alpha(theme.shade, theme.lineStrength)}`; | ||
} | ||
|
||
export default borderValue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import {css} from 'styled-components'; | ||
|
||
const centerChildren = css` | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
`; | ||
const centerChildren = { | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
}; | ||
|
||
export default centerChildren; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
import {css} from 'styled-components'; | ||
|
||
const fillParent = css` | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
bottom: 0; | ||
left: 0; | ||
`; | ||
const fillParent = { | ||
position: 'absolute', | ||
top: 0, | ||
right: 0, | ||
bottom: 0, | ||
left: 0, | ||
}; | ||
|
||
export default fillParent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,17 @@ | ||
import border from './border'; | ||
import borderValue from './borderValue'; | ||
import centerChildren from './centerChildren'; | ||
import ellipsis from './ellipsis'; | ||
import fillParent from './fillParent'; | ||
import ie11Hack from './ie11Hack'; | ||
import overflowWrap from './overflowWrap'; | ||
import visuallyHidden from './visuallyHidden'; | ||
import zIndex from './zIndex'; | ||
|
||
export { | ||
border, | ||
borderValue, | ||
centerChildren, | ||
ellipsis, | ||
fillParent, | ||
ie11Hack, | ||
overflowWrap, | ||
visuallyHidden, | ||
zIndex, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
import {css} from 'styled-components'; | ||
const overflowWrap = { | ||
overflowWrap: 'break-word', | ||
wordWrap: 'break-word', | ||
|
||
const overflowWrap = css` | ||
overflow-wrap: break-word; | ||
word-wrap: break-word; | ||
word-break: break-word; | ||
`; | ||
wordBreak: 'break-word', | ||
}; | ||
|
||
export default overflowWrap; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
import {css} from 'styled-components'; | ||
|
||
const visuallyHidden = css` | ||
position: absolute; | ||
overflow: hidden; | ||
width: 1px; | ||
height: 1px; | ||
padding: 0; | ||
clip: rect(0 0 0 0); | ||
border: 0; | ||
`; | ||
const visuallyHidden = { | ||
position: 'absolute', | ||
overflow: 'hidden', | ||
width: 1, | ||
height: 1, | ||
padding: 0, | ||
clip: 'rect(0 0 0 0)', | ||
border: 0, | ||
}; | ||
|
||
export default visuallyHidden; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters