Skip to content
This repository was archived by the owner on Feb 19, 2025. It is now read-only.

Commit 8c5b617

Browse files
committed
fix: force release
1 parent cdb5d3a commit 8c5b617

File tree

1 file changed

+14
-25
lines changed

1 file changed

+14
-25
lines changed

Diff for: README.md

+14-25
Original file line numberDiff line numberDiff line change
@@ -31,33 +31,30 @@ npm install @supabase/ui
3131
You will need to update tailwind.config.js in the root of your project.
3232

3333
#### Default tailwind.config.js tailwind setup
34+
3435
This is what a regular tailwind config file looks like
3536

3637
```js
37-
3838
// tailwind.config.js
3939

4040
module.exports = {
4141
content: [
42-
"./pages/**/*.{js,ts,jsx,tsx}",
43-
"./components/**/*.{js,ts,jsx,tsx}",
42+
'./pages/**/*.{js,ts,jsx,tsx}',
43+
'./components/**/*.{js,ts,jsx,tsx}',
4444
],
4545
theme: {
4646
extend: {},
4747
},
4848
plugins: [],
4949
}
50-
5150
```
5251

53-
5452
#### Update tailwind.config.js to the following
5553

5654
You will need to wrap the SupabaseUI config around your own tailwind config like below.
5755
Also add the new purge rules
5856

5957
```js
60-
6158
// using Supabase UI
6259

6360
// tailwind.config.js
@@ -69,14 +66,13 @@ module.exports = ui({
6966
'./components/**/*.{js,ts,jsx,tsx}',
7067
'./node_modules/@supabase/ui/dist/config/default-theme.js', // add this
7168
],
72-
theme: {
69+
theme: {
7370
extend: {},
7471
},
7572
plugins: [],
7673
})
7774
```
7875

79-
8076
## Using Supabase UI
8177

8278
### Colors
@@ -85,7 +81,7 @@ Supabase UI uses Radix Colors for everything, and all the colors are already set
8581

8682
#### Scale
8783

88-
In addition to accessing all colors from Radix, we have also assigned a new color pallete called `scale`. This is the designated grayscale color we use throughout all the component.
84+
In addition to accessing all colors from Radix, we have also assigned a new color pallete called `scale`. This is the designated grayscale color we use throughout all the component.
8985

9086
`scale`, as a default, is actually just the radix `gray` in dark mode, and radix `slate` in light mode. The colors are stored as CSS variables, so they can be swapped out for other color scales. These serve as the backbone of the components theme. It is advised you use `scale` wherever possible so that, if the scale theme is changed, everything will follow suite.
9187

@@ -95,14 +91,14 @@ As an example, and for aneyone interested, the CSS variables look a bit like thi
9591

9692
```css
9793
:root {
98-
--colors-scale1 : var(--colors-gray1)`;
99-
--colors-scale2 : var(--colors-gray2)`;
94+
--colors-scale1: var(--colors-gray1) `;
95+
--colors-scale2: var(--colors-gray2) `;
10096
/* and so on */
10197
}
10298

10399
.dark {
104-
--colors-scale1 : var(--colors-slate1)`;
105-
--colors-scale2 : var(--colors-slate2)`;
100+
--colors-scale1: var(--colors-slate1) `;
101+
--colors-scale2: var(--colors-slate2) `;
106102
/* and so on */
107103
}
108104
```
@@ -113,10 +109,9 @@ We have then populated tailwind with the relevant colors based on CSS variables,
113109

114110
A drawback to this is that [bg opacity classes eg: (bg-scale-100/25)](https://tailwindcss.com/docs/background-color#changing-the-opacity) don't work, although maybe a workaround can be figured out in the future.
115111

116-
Another, and possibly larger drawback, is that by relying on a 'color scale' as a theme, we are effectively making it quite hard to have element level theming. For example, custom themeing by a user to, perhaps, pick the 'app background color', or maybe the 'border color'. This is rather hard with this current solution but it's also a bit of a drawback with Tailwind its self as we declare the color and index of the color directly in jsx usually.
117-
118-
A possible workaround could be to create tailwind classes for various things, and then they reference a tailwind class themselves. Although that could be convoluted as we then have a custom tailwind class, referencing another tailwind class, which in turn references a CSS variable (pheww!).
112+
Another, and possibly larger drawback, is that by relying on a 'color scale' as a theme, we are effectively making it quite hard to have element level theming. For example, custom themeing by a user to, perhaps, pick the 'app background color', or maybe the 'border color'. This is rather hard with this current solution but it's also a bit of a drawback with Tailwind its self as we declare the color and index of the color directly in jsx usually.
119113

114+
A possible workaround could be to create tailwind classes for various things, and then they reference a tailwind class themselves. Although that could be convoluted as we then have a custom tailwind class, referencing another tailwind class, which in turn references a CSS variable (pheww!).
120115

121116
#### Dark mode
122117

@@ -133,19 +128,13 @@ For example, you may want to have a app background the same shade across light a
133128
You can just use tailwind dark mode classes as normal to achieve that:
134129

135130
```jsx
136-
137-
const index = () => {
131+
const index = () => (
138132
<body className="bg-scale-200">
139-
<div className="bg-scale-100 dark:bg-scale-300">
140-
This is a panel
141-
/* content in here */
142-
</div>
133+
<div className="bg-scale-100 dark:bg-scale-300">I am content</div>
143134
</body>
144-
}
135+
)
145136
```
146137

147-
148-
149138
### Typography
150139

151140
Use tailwind classes as normal for typography, but use `text-scale-*` classes for the text color.

0 commit comments

Comments
 (0)