-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Mark Dalgleish <[email protected]>
- Loading branch information
1 parent
d101b43
commit c6cd1f2
Showing
34 changed files
with
962 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@vanilla-extract/babel-plugin': minor | ||
--- | ||
|
||
Add debug IDs to `recipe` function |
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,8 @@ | ||
--- | ||
'@vanilla-extract/css': minor | ||
'@vanilla-extract/integration': minor | ||
--- | ||
|
||
Add `addFunctionSerializer` function | ||
|
||
This also marks `addRecipe` as deprecated. |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite App</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/index.ts"></script> | ||
</body> | ||
</html> |
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,12 @@ | ||
{ | ||
"name": "@fixtures/recipes", | ||
"version": "0.0.0", | ||
"main": "src/index.ts", | ||
"sideEffects": true, | ||
"author": "SEEK", | ||
"private": true, | ||
"dependencies": { | ||
"@vanilla-extract/css": "1.4.1", | ||
"@vanilla-extract/recipes": "0.1.0" | ||
} | ||
} |
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,12 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Snowpack App</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/dist/index.js"></script> | ||
</body> | ||
</html> |
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,26 @@ | ||
import { button, stack } from './styles.css'; | ||
|
||
function render() { | ||
document.body.innerHTML = ` | ||
<div class="${stack()}"> | ||
<button class="${button()}"> | ||
Standard calm button | ||
</button> | ||
<button class="${button({ size: 'small' })}"> | ||
Small calm button | ||
</button> | ||
<button class="${button({ tone: 'angry' })}"> | ||
Standard angry button | ||
</button> | ||
<button class="${button({ | ||
size: 'small', | ||
tone: 'angry', | ||
bold: true, | ||
})}"> | ||
Small angry button | ||
</button> | ||
</div> | ||
`; | ||
} | ||
|
||
render(); |
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,115 @@ | ||
import { style, createThemeContract, createTheme } from '@vanilla-extract/css'; | ||
import { recipe } from '@vanilla-extract/recipes'; | ||
|
||
const vars = createThemeContract({ | ||
bg: null, | ||
fg: null, | ||
}); | ||
|
||
const calm = createTheme(vars, { | ||
bg: 'powderblue', | ||
fg: 'white', | ||
}); | ||
|
||
const angry = createTheme(vars, { | ||
bg: 'crimson', | ||
fg: 'black', | ||
}); | ||
|
||
export const reset = style({ | ||
border: 0, | ||
}); | ||
|
||
export const button = recipe( | ||
{ | ||
base: [ | ||
reset, | ||
{ | ||
borderRadius: '6px', | ||
background: vars.bg, | ||
color: vars.fg, | ||
transition: 'all 0.2s ease', | ||
|
||
':hover': { | ||
transform: 'translateY(-3px)', | ||
}, | ||
}, | ||
], | ||
|
||
variants: { | ||
size: { | ||
small: { | ||
fontSize: '16px', | ||
lineHeight: '24px', | ||
}, | ||
standard: { | ||
fontSize: '24px', | ||
lineHeight: '40px', | ||
}, | ||
}, | ||
tone: { | ||
calm, | ||
angry: [ | ||
angry, | ||
{ | ||
':hover': { | ||
boxShadow: '0 10px 6px -6px #777', | ||
}, | ||
}, | ||
], | ||
}, | ||
bold: { | ||
true: { | ||
fontWeight: 'bold', | ||
}, | ||
}, | ||
}, | ||
|
||
defaultVariants: { | ||
size: 'standard', | ||
tone: 'calm', | ||
}, | ||
|
||
compoundVariants: [ | ||
{ | ||
variants: { | ||
size: 'small', | ||
bold: true, | ||
}, | ||
style: { | ||
'@media': { | ||
'only screen and (min-width: 600px)': { | ||
border: '2px green solid', | ||
}, | ||
}, | ||
}, | ||
}, | ||
], | ||
}, | ||
'button', | ||
); | ||
|
||
export const stack = recipe({ | ||
base: { | ||
display: 'flex', | ||
flexDirection: 'column', | ||
alignItems: 'flex-start', | ||
}, | ||
|
||
variants: { | ||
space: { | ||
medium: { | ||
gap: 20, | ||
'@media': { | ||
'only screen and (min-width: 600px)': { | ||
gap: 30, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
|
||
defaultVariants: { | ||
space: 'medium', | ||
}, | ||
}); |
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
Oops, something went wrong.