Skip to content

Commit

Permalink
Merge pull request #2 from RonMelkhior/next
Browse files Browse the repository at this point in the history
Tailwind 1.0
  • Loading branch information
RonMelkhior authored May 18, 2019
2 parents 26ee2bc + d78a5d2 commit 50c6390
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 156 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tailwindcss-dir",
"version": "2.0.0",
"version": "3.0.0",
"description": "Adds direction variants to your Tailwind project",
"main": "src/index.js",
"repository": "https://github.com/RonMelkhior/tailwindcss-dir.git",
Expand All @@ -15,7 +15,7 @@
"postcss": "^7.0.5"
},
"dependencies": {
"tailwindcss": "^0.7.0"
"tailwindcss": "^1.0.1"
},
"jest": {
"setupTestFrameworkScriptFile": "<rootDir>/jest/customMatchers.js"
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ function addSelectors(container, modifierFunction) {
return rules;
}

function generator({ addVariant }) {
function generator({ addVariant, e }) {
addVariant('direction', ({ container, separator }) => {
const result = container.clone({ nodes: [] });

['ltr', 'rtl'].forEach(dir => {
result.nodes = result.nodes.concat(
addSelectors(container, className => {
return `[dir='${dir}'] .${dir}${separator}${className}`;
return `[dir='${dir}'] .${dir}${e(separator)}${className}`;
})
);
});
Expand Down
2 changes: 1 addition & 1 deletion tests/config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const defaultConfig = require('tailwindcss/defaultConfig.stub');
const defaultConfig = require('tailwindcss/defaultConfig');
const plugin = require('../src/index');

module.exports = {
Expand Down
Loading

0 comments on commit 50c6390

Please sign in to comment.