-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update inline spacing treatment, using modern CSS features (#357)
- Loading branch information
1 parent
384810e
commit bbd33df
Showing
14 changed files
with
210 additions
and
245 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,30 @@ | ||
import { calc } from '@vanilla-extract/css-utils'; | ||
import { createVar, style } from '@vanilla-extract/css'; | ||
import { sprinkles, vars } from '../sprinkles.css'; | ||
import { style, createVar, styleVariants } from '@vanilla-extract/css'; | ||
import { vars } from '../sprinkles.css'; | ||
|
||
const size = createVar(); | ||
|
||
export const root = style([ | ||
sprinkles({ | ||
display: 'flex', | ||
flexWrap: 'wrap', | ||
}), | ||
{ | ||
marginTop: calc(size).negate().toString(), | ||
marginLeft: calc(size).negate().toString(), | ||
}, | ||
]); | ||
|
||
export const item = style({ | ||
paddingTop: size, | ||
paddingLeft: size, | ||
}); | ||
|
||
export const xxsmall = style({ | ||
vars: { | ||
[size]: vars.grid, | ||
}, | ||
}); | ||
|
||
export const xsmall = style({ | ||
vars: { | ||
[size]: calc(vars.grid).multiply(2).toString(), | ||
}, | ||
const horizontalAlignment = createVar(); | ||
|
||
export const gap = style({ | ||
display: 'flex', | ||
flexDirection: 'row', | ||
flexWrap: 'wrap', | ||
gap: size, | ||
alignItems: horizontalAlignment, | ||
}); | ||
|
||
export const small = style({ | ||
export const spaceScale = styleVariants(vars.space, (space) => ({ | ||
vars: { | ||
[size]: calc(vars.grid).multiply(3).toString(), | ||
[size]: space, | ||
}, | ||
}); | ||
|
||
export const medium = style({ | ||
vars: { | ||
[size]: calc(vars.grid).multiply(4).toString(), | ||
}, | ||
}); | ||
|
||
export const large = style({ | ||
vars: { | ||
[size]: calc(vars.grid).multiply(5).toString(), | ||
}, | ||
}); | ||
})); | ||
|
||
export const xlarge = style({ | ||
vars: { | ||
[size]: calc(vars.grid).multiply(6).toString(), | ||
export const horizontalAlignmentScale = styleVariants( | ||
{ | ||
top: 'flex-start', | ||
center: 'center', | ||
bottom: 'flex-end', | ||
}, | ||
}); | ||
(alignment) => ({ | ||
alignItems: alignment, | ||
}) | ||
); |
Oops, something went wrong.