Skip to content
This repository was archived by the owner on May 27, 2021. It is now read-only.

Rename dark-placeholder: to dark: for placeholderColor and new dark-divide for divideColor #21

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Variants for dark mode are based on [Tailwind's own variants](https://tailwindcs
- `dark-even`
- `dark-odd`
- `dark-placeholder`
- `dark-divide`

... and are used in the same way.

Expand All @@ -54,7 +55,9 @@ As with existing variants such as `hover` and `focus`, variants for dark mode mu
variants: {
backgroundColor: ['dark', 'dark-hover', 'dark-group-hover', 'dark-even', 'dark-odd'],
borderColor: ['dark', 'dark-focus', 'dark-focus-within'],
textColor: ['dark', 'dark-hover', 'dark-active', 'dark-placeholder']
textColor: ['dark', 'dark-hover', 'dark-active'],
placeholderColor: ['responsive', 'focus', 'dark-placeholder'],
divideColor: ['responsive', 'dark-divide']
}
```

Expand Down
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ module.exports = function() {

addVariant('dark-placeholder', ({modifySelectors, separator}) => {
modifySelectors(({className}) => {
return `${darkSelector} .${e(`dark-placeholder${separator}${className}`)}::placeholder`;
return `${darkSelector} .${e(`dark${separator}${className}`)}::placeholder`;
});
});

addVariant('dark-divide', ({modifySelectors, separator}) => {
modifySelectors(({className}) => {
return `${darkSelector} .${e(`dark${separator}${className}`)} > :not(template) ~ :not(template)`;
});
});
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tailwindcss-dark-mode",
"description": "A Tailwind CSS plugin that adds variants for dark mode",
"version": "1.1.4",
"version": "1.1.6",
"author": "Chance Arthur",
"license": "MIT",
"copyright": "Chance Arthur",
Expand Down