Skip to content

Commit ca1709b

Browse files
committed
feat: add ns-c-bind-scheme class for binding color schemes to elements
this is a better name for this
1 parent 745428d commit ca1709b

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

docs/colors.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ which contains values for these options which might go well together in a monoch
8989

9090
To apply the theme to a element you simply add the `neversink-{name}-scheme` class to the element and then add another class which binds the CSS vars as you like.
9191

92-
There is one built-in one called `.ns-c-mixin` which applies the color to the background, text, and border of the element. It's definition looks like this:
92+
There is one built-in one called `.ns-c-bind-scheme` which applies the color to the background, text, and border of the element. It's definition looks like this:
9393

9494
```css
95-
.ns-c-mixin {
95+
.ns-c-bind-scheme {
9696
background-color: var(--neversink-bg-color);
9797
color: var(--neversink-text-color);
9898
border-color: var(--neversink-border-color);
@@ -102,13 +102,13 @@ There is one built-in one called `.ns-c-mixin` which applies the color to the ba
102102
For example, to apply the `red` scheme from above to a `div` element you would add the following classes:
103103

104104
```html
105-
<div class="neversink-red-scheme ns-c-mixin">This is a red div</div>
105+
<div class="neversink-red-scheme ns-c-bind-scheme">This is a red div</div>
106106
```
107107

108108
You can also define you own custom binding classes if you want to map the colors from the theme in a different way. For example, you could define a class like this:
109109

110110
```css
111-
.mymixin {
111+
.my-bind-scheme {
112112
background-color: var(--neversink-text-color);
113113
}
114114
```

docs/styling.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ In addition to the main color [schemes](/colors) there are some additional short
2222

2323
where color is the **first two letters** of the [colors](/colors) in the project (e.g., `ns-c-pi-scheme` for `neversink-pink-scheme`).
2424

25-
## Color mixin
25+
## Color bind
2626

2727
When you want to apply a theme color to an element on a page you can use the
28-
`ns-c-mixin` class. This will apply the color to the text and the background.
28+
`ns-c-bind-scheme` class. This will apply the color to the text and the background.
2929

3030
It has a definition like this:
3131

3232
```css
33-
.ns-c-mixin {
33+
.ns-c-bind-scheme {
3434
background-color: var(--neversink-bg-color);
3535
color: var(--neversink-text-color);
3636
border-color: var(--neversink-border-color);
@@ -40,7 +40,7 @@ It has a definition like this:
4040
so to bind the color to a `div` element you can do this:
4141

4242
```md
43-
<div class="ns-c-mixin ns-c-sk-scheme">
43+
<div class="ns-c-bind-scheme ns-c-sk-scheme">
4444
This is a with the `ns-c-sk-scheme` (i.e., `neversink-sky-scheme`) color applied.
4545
</div>
4646
```

styles/neversink-c.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@
154154
pointer-events: none;
155155
}
156156

157+
.ns-c-bind-scheme,
157158
.ns-c-mixin {
158159
background-color: var(--neversink-bg-color);
159160
color: var(--neversink-text-color);

0 commit comments

Comments
 (0)