Skip to content

Commit da0c656

Browse files
committed
Scope tailwind reset
1 parent cca2fb8 commit da0c656

File tree

4 files changed

+80
-66
lines changed

4 files changed

+80
-66
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"react": "^18.2.0",
5151
"react-dom": "^18.2.0",
5252
"tailwindcss": "^3.3.3",
53+
"tailwindcss-scoped-preflight": "^2.0.2",
5354
"typecheck": "^0.1.2",
5455
"xstate": "^4.37.2"
5556
},

src/pages/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { Navbar } from '../components/landing/Navbar';
88
import { Testimonials } from '../components/landing/Testimonials';
99
import '../css/landing-page.css';
1010
import '../css/landing-styles.css';
11+
// import '../css/preflight.css';
1112

1213
export default function Index() {
1314
useEffect(() => {
@@ -72,10 +73,10 @@ export default function Index() {
7273
src="https://plausible.io/js/script.tagged-events.js"
7374
></script>
7475
</Head>
75-
<header className="bg-blue-950/20 border-b-white/[0.08] border-b fixed w-full z-10 backdrop-blur-md">
76+
<header className="bg-blue-950/20 border-b-white/[0.08] border-b fixed w-full z-10 backdrop-blur-md twp">
7677
<Navbar />
7778
</header>
78-
<main className="bg-blue-950">
79+
<main className="bg-blue-950 twp">
7980
<Intro />
8081
<Benefits />
8182
<Testimonials />

tailwind.config.js

Lines changed: 71 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const { scopedPreflightStyles } = require('tailwindcss-scoped-preflight');
2+
13
/** @type {import('tailwindcss').Config} */
24
module.exports = {
35
content: ['./src/**/*.{js,jsx,ts,tsx}'],
@@ -26,82 +28,87 @@ module.exports = {
2628
900: '#15151d',
2729
},
2830
blue: {
29-
50: "#e6f2fe",
30-
100: "#cee6fa",
31-
200: "#aed5fa",
32-
300: "#90c7fc",
33-
400: "#63a3fc",
34-
500: "#0f6ee5",
35-
600: "#005cde",
36-
700: "#2949a5",
37-
800: "#19296e",
31+
50: '#e6f2fe',
32+
100: '#cee6fa',
33+
200: '#aed5fa',
34+
300: '#90c7fc',
35+
400: '#63a3fc',
36+
500: '#0f6ee5',
37+
600: '#005cde',
38+
700: '#2949a5',
39+
800: '#19296e',
3840
850: '#102157',
39-
900: "#0c1238",
40-
950: '#000622'
41+
900: '#0c1238',
42+
950: '#000622',
4143
},
4244
pink: {
43-
50: "#ffeafe",
44-
100: "#fdd7fd",
45-
200: "#fbbdf8",
46-
300: "#fca5ef",
47-
400: "#f571d3",
48-
500: "#cf249b",
49-
600: "#bd0c8b",
50-
700: "#95146b",
51-
800: "#5d0843",
52-
900: "#310121"
45+
50: '#ffeafe',
46+
100: '#fdd7fd',
47+
200: '#fbbdf8',
48+
300: '#fca5ef',
49+
400: '#f571d3',
50+
500: '#cf249b',
51+
600: '#bd0c8b',
52+
700: '#95146b',
53+
800: '#5d0843',
54+
900: '#310121',
5355
},
5456
orange: {
55-
50: "#ffeed3",
56-
100: "#ffdeae",
57-
200: "#ffc77a",
58-
300: "#ffb255",
59-
400: "#f18622",
60-
500: "#c14f0f",
61-
600: "#af4108",
62-
700: "#8a3500",
63-
800: "#561e00",
64-
900: "#2c0c00"
57+
50: '#ffeed3',
58+
100: '#ffdeae',
59+
200: '#ffc77a',
60+
300: '#ffb255',
61+
400: '#f18622',
62+
500: '#c14f0f',
63+
600: '#af4108',
64+
700: '#8a3500',
65+
800: '#561e00',
66+
900: '#2c0c00',
6567
},
6668
green: {
67-
50: "#e2f7d8",
68-
100: "#c9edbc",
69-
200: "#a8df97",
70-
300: "#8ad47b",
71-
400: "#54b559",
72-
500: "#29833b",
73-
600: "#0f7528",
74-
700: "#265a2f",
75-
800: "#14371c",
76-
900: "#071a0c"
69+
50: '#e2f7d8',
70+
100: '#c9edbc',
71+
200: '#a8df97',
72+
300: '#8ad47b',
73+
400: '#54b559',
74+
500: '#29833b',
75+
600: '#0f7528',
76+
700: '#265a2f',
77+
800: '#14371c',
78+
900: '#071a0c',
7779
},
7880
purple: {
79-
50: "#f9ecfe",
80-
100: "#edddfb",
81-
200: "#dac9f7",
82-
300: "#cfb7f6",
83-
400: "#b092ee",
84-
500: "#8355e5",
85-
600: "#7245dc",
86-
700: "#5c31b9",
87-
800: "#341c79",
88-
900: "#180b3f"
81+
50: '#f9ecfe',
82+
100: '#edddfb',
83+
200: '#dac9f7',
84+
300: '#cfb7f6',
85+
400: '#b092ee',
86+
500: '#8355e5',
87+
600: '#7245dc',
88+
700: '#5c31b9',
89+
800: '#341c79',
90+
900: '#180b3f',
8991
},
9092
teal: {
91-
50: "#e1f4f6",
92-
100: "#c3eaee",
93-
200: "#99dce7",
94-
300: "#86cdd9",
95-
400: "#48afc2",
96-
500: "#227c93",
97-
600: "#166d8b",
98-
700: "#1c5572",
99-
800: "#103348",
100-
900: "#061724"
101-
}
93+
50: '#e1f4f6',
94+
100: '#c3eaee',
95+
200: '#99dce7',
96+
300: '#86cdd9',
97+
400: '#48afc2',
98+
500: '#227c93',
99+
600: '#166d8b',
100+
700: '#1c5572',
101+
800: '#103348',
102+
900: '#061724',
103+
},
102104
},
103105
},
104-
105106
},
106-
plugins: [],
107+
corePlugins: { preflight: false },
108+
plugins: [
109+
scopedPreflightStyles({
110+
cssSelector: '.twp', // or .tailwind-preflight or even [data-twp=true] - any valid CSS selector of your choice
111+
mode: 'matched only', // it's the default
112+
}),
113+
],
107114
};

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8560,6 +8560,11 @@ svgo@^2.7.0, svgo@^2.8.0:
85608560
picocolors "^1.0.0"
85618561
stable "^0.1.8"
85628562

8563+
tailwindcss-scoped-preflight@^2.0.2:
8564+
version "2.0.2"
8565+
resolved "https://registry.yarnpkg.com/tailwindcss-scoped-preflight/-/tailwindcss-scoped-preflight-2.0.2.tgz#aeca934fb0981040f81cddabbb2405e20dc8423a"
8566+
integrity sha512-R306riOQ9lzP0uRfthR8v7Fv0GH4guqZmA8l4Y5Iyt/Bhbmyk2Ze4c27LyNljkaItFXAs+/rDAAULa/aZnqcqw==
8567+
85638568
tailwindcss@^3.3.3:
85648569
version "3.3.3"
85658570
resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-3.3.3.tgz#90da807393a2859189e48e9e7000e6880a736daf"

0 commit comments

Comments
 (0)