-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtailwind.config.js
65 lines (62 loc) · 1.52 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
import plugin from 'tailwindcss/plugin';
import typography from '@tailwindcss/typography';
import skipLink from 'tailwindcss-skip-link';
/** @type {import('tailwindcss').Config} */
export default {
content: [
'./assets/**/*.js',
'./content/**/*.{html,js,md}',
'./layouts/**/*.{html,js}',
],
safelist: [{ pattern: /^hero-/ }, 'float-right'],
theme: {
heroes: [
'main',
'i6VBVfcerso',
'hFzIoD0Fi8',
'jb1Mc1lv8X0',
'gE08jRp3Qw4',
// additional hero images here
],
fontFamily: {
title: ['Raleway', 'sans-serif'],
sans: [
'Montserrat',
'-apple-system',
'BlinkMacSystemFont',
'Segoe UI',
'Roboto',
'Helvetica Neue',
'Arial',
'Noto Sans',
'sans-serif',
],
},
extend: {},
},
plugins: [
typography,
skipLink(),
plugin(({ addComponents, theme }) => {
const heroes = theme('heroes', []);
const screens = theme('screens', {});
delete screens['2xl'];
addComponents(
heroes.map((hero) => ({
[`.hero-${hero}`]: {
'background-image': `url("/images/hero/${hero}.webp")`,
},
})),
);
Object.entries(screens).forEach(([name, width]) => {
addComponents({
[`@media (min-width: ${width})`]: heroes.map((hero) => ({
[`.hero-${hero}`]: {
'background-image': `url("/images/hero/${hero}-${name}.webp")`,
},
})),
});
});
}),
],
};