-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtailwind.config.cjs
65 lines (64 loc) · 2.18 KB
/
tailwind.config.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import defaultTheme from 'tailwindcss/defaultTheme';
import typographyPlugin from '@tailwindcss/typography';
import plugin from 'tailwindcss/plugin';
module.exports = {
content: ['./src/**/*.{astro,html,js,jsx,json,md,mdx,svelte,ts,tsx,vue}'],
theme: {
extend: {
colors: {
primary: 'var(--aw-color-primary)',
secondary: 'var(--aw-color-secondary)',
accent: 'var(--aw-color-accent)',
default: 'var(--aw-color-text-default)',
muted: 'var(--aw-color-text-muted)',
},
fontFamily: {
sans: ['var(--aw-font-sans, ui-sans-serif)', ...defaultTheme.fontFamily.sans],
serif: ['var(--aw-font-serif, ui-serif)', ...defaultTheme.fontFamily.serif],
heading: ['var(--aw-font-heading, ui-sans-serif)', ...defaultTheme.fontFamily.sans],
},
},
},
plugins: [
typographyPlugin,
plugin(({ addComponents }) => [
addComponents({
// Using before as state-layer
// See https://m3.material.io/foundations/interaction-states for theory behind this
// Opacities are the same for all button types,
// so this style can be re-used for all components that need a state layer
// Set the bg-color of the before element using before: in the tailwind style
'.statelayer': {
overflow: 'hidden',
position: 'relative',
'&::before': {
bottom: '0px',
left: '0px',
opacity: 0,
position: 'absolute',
right: '0px',
top: '0px',
},
'@media only screen and (hover: hover)': {
'&:not(:disabled):not([aria-disabled="true"]):hover::before': {
opacity: '.08',
},
},
'&:not(:disabled):not([aria-disabled="true"]):focus-visible::before': {
opacity: '.12',
},
'&:not(:disabled):not([aria-disabled="true"]):active::before': {
opacity: '.12',
},
'&[data-state-layer="soft"]::before': {
opacity: '.08',
},
'&[data-state-layer="medium"]::before': {
opacity: '.12',
},
},
}),
]),
],
darkMode: 'class',
};