Skip to content

Commit

Permalink
Rename tailwind() method to config()
Browse files Browse the repository at this point in the history
Add basic tests for config(), @response and @apply.
  • Loading branch information
reinink committed Oct 30, 2017
1 parent 75c24bc commit 96e9e67
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
25 changes: 25 additions & 0 deletions __tests__/fixtures/tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -3714,6 +3714,11 @@ button,
padding: 0;
}

.example {
font-weight: 700;
color: #e3342f;
}

@media (min-width: 576px) {
.sm\:input-reset {
appearance: none;
Expand Down Expand Up @@ -6842,6 +6847,11 @@ button,
margin: 0;
padding: 0;
}

.sm\:example {
font-weight: 700;
color: #e3342f;
}
}

@media (min-width: 768px) {
Expand Down Expand Up @@ -9972,6 +9982,11 @@ button,
margin: 0;
padding: 0;
}

.md\:example {
font-weight: 700;
color: #e3342f;
}
}

@media (min-width: 992px) {
Expand Down Expand Up @@ -13102,6 +13117,11 @@ button,
margin: 0;
padding: 0;
}

.lg\:example {
font-weight: 700;
color: #e3342f;
}
}

@media (min-width: 1200px) {
Expand Down Expand Up @@ -16232,4 +16252,9 @@ button,
margin: 0;
padding: 0;
}

.xl\:example {
font-weight: 700;
color: #e3342f;
}
}
7 changes: 7 additions & 0 deletions css/tailwind.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
@tailwind reset;

@tailwind utilities;

@responsive {
.example {
@apply .font-bold;
color: config('colors.red');
}
}
2 changes: 1 addition & 1 deletion src/lib/evaluateTailwindFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import functions from 'postcss-functions'
export default function(options) {
return functions({
functions: {
tailwind: function (path) {
config: function (path) {
return _.get(options, _.trim(path, `'"`))
}
}
Expand Down

0 comments on commit 96e9e67

Please sign in to comment.