Skip to content

Rename core plugins to closer mirror CSS properties and modules #656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Feb 18, 2019
Merged
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
550 changes: 275 additions & 275 deletions __tests__/fixtures/tailwind-output-important.css

Large diffs are not rendered by default.

550 changes: 275 additions & 275 deletions __tests__/fixtures/tailwind-output.css

Large diffs are not rendered by default.

27 changes: 15 additions & 12 deletions defaultConfig.stub.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@ module.exports = {
variants: {
appearance: ['responsive'],
backgroundAttachment: ['responsive'],
backgroundColors: ['responsive', 'hover', 'focus'],
backgroundColor: ['responsive', 'hover', 'focus'],
backgroundPosition: ['responsive'],
backgroundRepeat: ['responsive'],
backgroundSize: ['responsive'],
borderCollapse: [],
borderColors: ['responsive', 'hover', 'focus'],
borderColor: ['responsive', 'hover', 'focus'],
borderRadius: ['responsive'],
borderStyle: ['responsive'],
borderWidths: ['responsive'],
borderWidth: ['responsive'],
cursor: ['responsive'],
display: ['responsive'],
flexbox: ['responsive'],
float: ['responsive'],
fonts: ['responsive'],
fontWeights: ['responsive', 'hover', 'focus'],
fontFamily: ['responsive'],
fontWeight: ['responsive', 'hover', 'focus'],
height: ['responsive'],
leading: ['responsive'],
lists: ['responsive'],
listStyle: ['responsive'],
margin: ['responsive'],
maxHeight: ['responsive'],
maxWidth: ['responsive'],
Expand All @@ -41,14 +41,17 @@ module.exports = {
pointerEvents: ['responsive'],
position: ['responsive'],
resize: ['responsive'],
shadows: ['responsive', 'hover', 'focus'],
svgFill: [],
svgStroke: [],
boxShadow: ['responsive', 'hover', 'focus'],
fill: [],
stroke: [],
tableLayout: ['responsive'],
textAlign: ['responsive'],
textColors: ['responsive', 'hover', 'focus'],
textSizes: ['responsive'],
textStyle: ['responsive', 'hover', 'focus'],
textColor: ['responsive', 'hover', 'focus'],
fontSize: ['responsive'],
fontStyle: ['responsive', 'hover', 'focus'],
textTransform: ['responsive', 'hover', 'focus'],
textDecoration: ['responsive', 'hover', 'focus'],
fontSmoothing: ['responsive', 'hover', 'focus'],
tracking: ['responsive'],
userSelect: ['responsive'],
verticalAlign: ['responsive'],
Expand Down
20 changes: 10 additions & 10 deletions defaultTheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ module.exports = function() {
lg: '992px',
xl: '1200px',
},
fonts: {
fontFamily: {
sans: [
'system-ui',
'BlinkMacSystemFont',
Expand Down Expand Up @@ -137,7 +137,7 @@ module.exports = function() {
],
mono: ['Menlo', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', 'monospace'],
},
textSizes: {
fontSize: {
xs: '.75rem', // 12px
sm: '.875rem', // 14px
base: '1rem', // 16px
Expand All @@ -148,7 +148,7 @@ module.exports = function() {
'4xl': '2.25rem', // 36px
'5xl': '3rem', // 48px
},
fontWeights: {
fontWeight: {
hairline: 100,
thin: 200,
light: 300,
Expand All @@ -170,8 +170,8 @@ module.exports = function() {
normal: '0',
wide: '0.05em',
},
textColors: theme => theme.colors,
backgroundColors: theme => theme.colors,
textColor: theme => theme.colors,
backgroundColor: theme => theme.colors,
backgroundPosition: {
bottom: 'bottom',
center: 'center',
Expand All @@ -188,14 +188,14 @@ module.exports = function() {
cover: 'cover',
contain: 'contain',
},
borderWidths: {
borderWidth: {
default: '1px',
'0': '0',
'2': '2px',
'4': '4px',
'8': '8px',
},
borderColors: theme => {
borderColor: theme => {
return global.Object.assign({ default: theme.colors['grey-light'] }, theme.colors)
},
borderRadius: {
Expand Down Expand Up @@ -260,7 +260,7 @@ module.exports = function() {
padding: theme => theme.spacing,
margin: theme => ({ auto: 'auto', ...theme.spacing }),
negativeMargin: theme => theme.spacing,
shadows: {
boxShadow: {
default: '0 2px 4px 0 rgba(0,0,0,0.10)',
md: '0 4px 8px 0 rgba(0,0,0,0.12), 0 2px 4px 0 rgba(0,0,0,0.08)',
lg: '0 15px 30px 0 rgba(0,0,0,0.11), 0 5px 15px 0 rgba(0,0,0,0.08)',
Expand All @@ -284,10 +284,10 @@ module.exports = function() {
'75': '.75',
'100': '1',
},
svgFill: {
fill: {
current: 'currentColor',
},
svgStroke: {
stroke: {
current: 'currentColor',
},
}
Expand Down
1 change: 1 addition & 0 deletions plugins/backgroundColor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../lib/plugins/backgroundColor').default
1 change: 0 additions & 1 deletion plugins/backgroundColors.js

This file was deleted.

1 change: 1 addition & 0 deletions plugins/borderColor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../lib/plugins/borderColor').default
1 change: 0 additions & 1 deletion plugins/borderColors.js

This file was deleted.

1 change: 1 addition & 0 deletions plugins/borderWidth.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../lib/plugins/borderWidth').default
1 change: 0 additions & 1 deletion plugins/borderWidths.js

This file was deleted.

1 change: 1 addition & 0 deletions plugins/boxShadow.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../lib/plugins/boxShadow').default
1 change: 1 addition & 0 deletions plugins/fill.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../lib/plugins/fill').default
1 change: 1 addition & 0 deletions plugins/fontFamily.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../lib/plugins/fontFamily').default
1 change: 1 addition & 0 deletions plugins/fontSize.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../lib/plugins/fontSize').default
1 change: 1 addition & 0 deletions plugins/fontSmoothing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../lib/plugins/fontSmoothing').default
1 change: 1 addition & 0 deletions plugins/fontStyle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../lib/plugins/fontStyle').default
1 change: 1 addition & 0 deletions plugins/fontWeight.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../lib/plugins/fontWeight').default
1 change: 0 additions & 1 deletion plugins/fontWeights.js

This file was deleted.

1 change: 0 additions & 1 deletion plugins/fonts.js

This file was deleted.

1 change: 1 addition & 0 deletions plugins/listStyle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../lib/plugins/listStyle').default
1 change: 0 additions & 1 deletion plugins/lists.js

This file was deleted.

1 change: 0 additions & 1 deletion plugins/shadows.js

This file was deleted.

1 change: 1 addition & 0 deletions plugins/stroke.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../lib/plugins/stroke').default
1 change: 0 additions & 1 deletion plugins/svgFill.js

This file was deleted.

1 change: 0 additions & 1 deletion plugins/svgStroke.js

This file was deleted.

1 change: 1 addition & 0 deletions plugins/textColor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../lib/plugins/textColor').default
1 change: 0 additions & 1 deletion plugins/textColors.js

This file was deleted.

1 change: 1 addition & 0 deletions plugins/textDecoration.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../lib/plugins/textDecoration').default
1 change: 0 additions & 1 deletion plugins/textSizes.js

This file was deleted.

1 change: 0 additions & 1 deletion plugins/textStyle.js

This file was deleted.

1 change: 1 addition & 0 deletions plugins/textTransform.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../lib/plugins/textTransform').default
54 changes: 30 additions & 24 deletions src/corePlugins.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import preflight from './plugins/preflight'
import lists from './plugins/lists'
import listStyle from './plugins/listStyle'
import appearance from './plugins/appearance'
import backgroundAttachment from './plugins/backgroundAttachment'
import backgroundColors from './plugins/backgroundColors'
import backgroundColor from './plugins/backgroundColor'
import backgroundPosition from './plugins/backgroundPosition'
import backgroundRepeat from './plugins/backgroundRepeat'
import backgroundSize from './plugins/backgroundSize'
import borderCollapse from './plugins/borderCollapse'
import borderColors from './plugins/borderColors'
import borderColor from './plugins/borderColor'
import borderRadius from './plugins/borderRadius'
import borderStyle from './plugins/borderStyle'
import borderWidths from './plugins/borderWidths'
import borderWidth from './plugins/borderWidth'
import cursor from './plugins/cursor'
import display from './plugins/display'
import flexbox from './plugins/flexbox'
import float from './plugins/float'
import fonts from './plugins/fonts'
import fontWeights from './plugins/fontWeights'
import fontFamily from './plugins/fontFamily'
import fontWeight from './plugins/fontWeight'
import height from './plugins/height'
import leading from './plugins/leading'
import margin from './plugins/margin'
Expand All @@ -34,14 +34,17 @@ import padding from './plugins/padding'
import pointerEvents from './plugins/pointerEvents'
import position from './plugins/position'
import resize from './plugins/resize'
import shadows from './plugins/shadows'
import svgFill from './plugins/svgFill'
import svgStroke from './plugins/svgStroke'
import boxShadow from './plugins/boxShadow'
import fill from './plugins/fill'
import stroke from './plugins/stroke'
import tableLayout from './plugins/tableLayout'
import textAlign from './plugins/textAlign'
import textColors from './plugins/textColors'
import textSizes from './plugins/textSizes'
import textStyle from './plugins/textStyle'
import textColor from './plugins/textColor'
import fontSize from './plugins/fontSize'
import fontStyle from './plugins/fontStyle'
import textTransform from './plugins/textTransform'
import textDecoration from './plugins/textDecoration'
import fontSmoothing from './plugins/fontSmoothing'
import tracking from './plugins/tracking'
import userSelect from './plugins/userSelect'
import verticalAlign from './plugins/verticalAlign'
Expand Down Expand Up @@ -70,24 +73,24 @@ function loadPlugins({ theme, variants, corePlugins }, plugins) {
export default function(config) {
return loadPlugins(config, {
preflight,
lists,
listStyle,
appearance,
backgroundAttachment,
backgroundColors,
backgroundColor,
backgroundPosition,
backgroundRepeat,
backgroundSize,
borderCollapse,
borderColors,
borderColor,
borderRadius,
borderStyle,
borderWidths,
borderWidth,
cursor,
display,
flexbox,
float,
fonts,
fontWeights,
fontFamily,
fontWeight,
height,
leading,
margin,
Expand All @@ -105,14 +108,17 @@ export default function(config) {
pointerEvents,
position,
resize,
shadows,
svgFill,
svgStroke,
boxShadow,
fill,
stroke,
tableLayout,
textAlign,
textColors,
textSizes,
textStyle,
textColor,
fontSize,
fontStyle,
textTransform,
textDecoration,
fontSmoothing,
tracking,
userSelect,
verticalAlign,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/plugins/css/preflight.css
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ ul {
*::after {
border-width: 0;
border-style: solid;
border-color: config('theme.borderColors.default', currentColor);
border-color: config('theme.borderColor.default', currentColor);
}

/**
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions src/plugins/fontSmoothing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export default function({ variants }) {
return function({ addUtilities }) {
addUtilities(
{
'.antialiased': {
'-webkit-font-smoothing': 'antialiased',
'-moz-osx-font-smoothing': 'grayscale',
},
'.subpixel-antialiased': {
'-webkit-font-smoothing': 'auto',
'-moz-osx-font-smoothing': 'auto',
},
},
variants
)
}
}
11 changes: 11 additions & 0 deletions src/plugins/fontStyle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export default function({ variants }) {
return function({ addUtilities }) {
addUtilities(
{
'.italic': { 'font-style': 'italic' },
'.roman': { 'font-style': 'normal' },
},
variants
)
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions src/plugins/textDecoration.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export default function({ variants }) {
return function({ addUtilities }) {
addUtilities(
{
'.underline': { 'text-decoration': 'underline' },
'.line-through': { 'text-decoration': 'line-through' },
'.no-underline': { 'text-decoration': 'none' },
},
variants
)
}
}
29 changes: 0 additions & 29 deletions src/plugins/textStyle.js

This file was deleted.

13 changes: 13 additions & 0 deletions src/plugins/textTransform.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export default function({ variants }) {
return function({ addUtilities }) {
addUtilities(
{
'.uppercase': { 'text-transform': 'uppercase' },
'.lowercase': { 'text-transform': 'lowercase' },
'.capitalize': { 'text-transform': 'capitalize' },
'.normal-case': { 'text-transform': 'none' },
},
variants
)
}
}