-
-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # README.md
- Loading branch information
Showing
9 changed files
with
119 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Twin and Tailwind differences | ||
|
||
This document outlines the feature differences between Twin and Tailwind. | ||
|
||
## Additional features | ||
|
||
- tw can be imported as a named import<br/>eg: `import { tw } from 'twin.macro'`<br/>You'll receive errors in a TypeScript project though | ||
- `container` has left/right margins | ||
- `container` has left/right paddings | ||
- Variants can be stacked<br/>eg: `md:before:flex!` | ||
- You can add a negative value to just about any measurement class | ||
|
||
## Twin doesn't have | ||
|
||
- [Class prefixes](https://tailwindcss.com/docs/configuration/#prefix) | ||
- [Custom separators](https://tailwindcss.com/docs/configuration/#separator) | ||
- You can't disable [core plugins](https://tailwindcss.com/docs/configuration/#core-plugins) | ||
- Twin doesn't have an `important` option in your config<br/>Use the trailing bang feature instead, eg: `flex!` | ||
- You can't limit the available variants on each class, all of them are always available |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const addDebugProperty = ({ t, attributes, rawClasses, path, state }) => { | ||
if (state.isProd || !state.debugProp) return | ||
|
||
// Remove the existing debug attribute if you happen to have it | ||
const debugProperty = attributes.filter( | ||
p => p.node.name && p.node.name.name === 'data-tw' | ||
) | ||
debugProperty.forEach(path => path.remove()) | ||
// Add the attribute | ||
path.insertAfter( | ||
t.jsxAttribute(t.jsxIdentifier('data-tw'), t.stringLiteral(rawClasses)) | ||
) | ||
} | ||
|
||
export default addDebugProperty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters