-
Notifications
You must be signed in to change notification settings - Fork 1
/
tailwind.config.js
145 lines (144 loc) · 4.62 KB
/
tailwind.config.js
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
const plugin = require('tailwindcss/plugin');
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./src/**/*.astro'],
darkMode: ['class', '[data-theme="dark"]'],
future: {
hoverOnlyWhenSupported: true,
},
theme: {
screens: {
lg: { max: '1366px' },
md: { max: '700px' },
sm: { max: '450px' },
},
fontFamily: {
body: ['Inter', 'sans-serif'],
mono: ['Menlo', 'monospace'],
},
colors: {
transparent: 'transparent',
current: 'currentColor',
bg: {
body: 'rgb(var(--color-bg-body) / <alpha-value>)',
gradient: 'rgb(var(--color-bg-gradient) / <alpha-value>)',
code: 'rgb(var(--color-bg-code) / <alpha-value>)',
selection: 'rgb(var(--color-bg-selection) / <alpha-value>)',
border: 'rgb(var(--color-text-body) / 10%)',
},
primary: {
DEFAULT: 'rgb(var(--color-primary) / <alpha-value>)',
light: 'rgb(var(--color-primary-light) / <alpha-value>)',
dark: 'rgb(var(--color-primary-dark) / <alpha-value>)',
},
secondary: {
DEFAULT: 'rgb(var(--color-secondary) / <alpha-value>)',
},
text: {
heading: 'rgb(var(--color-text-heading) / <alpha-value>)',
body: 'rgb(var(--color-text-body) / <alpha-value>)',
muted: 'rgb(var(--color-text-body) / 56%)',
bold: 'rgb(var(--color-text-bold) / <alpha-value>)',
link: 'rgb(var(--color-secondary) / <alpha-value>)',
code: 'rgb(var(--color-text-code) / <alpha-value>)',
selection: 'rgb(var(--color-text-selection) / <alpha-value>)',
},
border: {
code: 'rgb(var(--color-border-code) / <alpha-value>)',
},
},
extend: {
height: {
navbar: '5rem',
footer: '5rem',
},
backgroundImage: {
'bg-gradient':
'linear-gradient(180deg, rgb(var(--color-bg-body)), rgb(var(--color-bg-body)), rgb(var(--color-bg-gradient)))',
},
},
},
plugins: [
plugin(function ({ addComponents, theme }) {
const mdQuery = `@media (max-width: ${theme('screens.md.max')})`;
const smQuery = `@media (max-width: ${theme('screens.sm.max')})`;
addComponents({
'.break-padding': {
[mdQuery]: {
marginRight: '-1.4rem',
marginLeft: '-1.4rem',
},
[smQuery]: {
marginRight: '-0.9rem',
marginLeft: '-0.9rem',
},
},
'.gradient-text': {
color: 'transparent',
backgroundImage:
'linear-gradient(to bottom right, rgb(var(--color-primary-light)), rgb(var(--color-primary)), rgb(var(--color-primary-light)))',
backgroundClip: 'text',
backgroundPosition: 0,
backgroundSize: '200% 200%',
},
'.slideup-text': {
willChange: 'transform',
transform: 'translateY(80px) translateZ(0)',
animation: 'slide-up 0.8s cubic-bezier(0.075, 0.82, 0.165, 1) forwards',
},
'.icon-link': {
transition: 'color 0.2s',
'@media (hover: hover) and (pointer: fine)': {
'&:hover': {
color: 'rgb(var(--color-secondary))',
},
},
},
'.card-list': {
display: 'grid',
gap: '1.5rem',
gridTemplateColumns: 'repeat(2, minmax(0, 1fr))',
[mdQuery]: {
gridTemplateColumns: 'repeat(1, minmax(0, 1fr))',
},
},
'.card': {
display: 'flex',
opacity: '0',
animation: 'fadein 0.8s ease forwards',
'& > .card-inner': {
width: '100%',
display: 'flex',
flexDirection: 'column',
position: 'relative',
padding: '1.6rem',
background: `${theme('backgroundImage.bg-gradient')}`,
borderRadius: '0.5rem',
'&::after': {
content: '""',
position: 'absolute',
zIndex: '-100',
top: '0',
right: '0',
bottom: '0',
left: '0',
backgroundImage:
'linear-gradient(235deg, rgb(var(--color-secondary)), rgb(var(--color-bg-body)), rgb(var(--color-primary)))',
filter: 'blur(6px)',
transition: 'all 0.3s',
},
'@media (hover: hover) and (pointer: fine)': {
'&:hover::after': {
top: '-4px',
right: '-4px',
bottom: '-4px',
left: '-4px',
filter: 'blur(9px)',
},
},
},
},
});
}),
],
};