Skip to content

Commit

Permalink
Merge pull request #48 from crswll/readme-update
Browse files Browse the repository at this point in the history
  • Loading branch information
crswll authored Dec 22, 2023
2 parents bb38950 + d4bea0b commit f8839e9
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ const themes = [
selectors: [':root'],
theme: {
colors: {
primary: '#222',
primary: 'hsl(0 100% 50%)',
},
spacing: {
sm: '3px',
},
},
},
Expand All @@ -128,16 +131,15 @@ const themes = [
mediaQuery: '@media (prefers-color-scheme: dark)',
theme: {
colors: {
primary: '#ddd',
primary: 'darkslateblue',
},
},
},
{
name: 'high-contrast',
mediaQuery: '@media (prefers-contrast: high)',
selectors: ['.lime']
theme: {
colors: {
primary: '#ddd',
primary: '#0f0',
},
},
},
Expand All @@ -148,39 +150,37 @@ const themes = [

```css
:root {
--colors-primary: 34 34 34
}

@media (prefers-color-scheme: dark) {
:root {
--colors-primary: 221 221 221
}
--colors-primary: hsl(0 100% 50%);
--spacing-sm: 3px
}

.dark, [dark], [data-theme="dark"] {
--colors-primary: 221 221 221
--colors-primary: darkslateblue
}

@media (prefers-contrast: high) {
:root {
--colors-primary: 255 255 255
@media (prefers-color-scheme: dark) {
:root{
--colors-primary: darkslateblue
}
}

/* ... */

.text-primary {
--tw-text-opacity: 1;
color: rgb(var(--colors-primary) / var(--tw-text-opacity));
.lime {
--colors-primary: #0f0
}

/* ... */

.bg-primary {
--tw-bg-opacity: 1;
background-color: rgb(var(--colors-primary) / var(--tw-bg-opacity));
background-color: color-mix(in srgb, var(--colors-primary), transparent calc(100% - 100% * var(--tw-bg-opacity)))
}

.text-primary {
--tw-text-opacity: 1;
background-color: color-mix(in srgb, var(--colors-primary), transparent calc(100% - 100% * var(--tw-text-opacity)))
}

.border-primary {
--tw-border-opacity: 1;
border-color: rgb(var(--colors-primary) / var(--tw-border-opacity));
.p-sm {
padding: var(--spacing-sm)
}
```

0 comments on commit f8839e9

Please sign in to comment.