Skip to content

Instantly share code, notes, and snippets.

@rahuls360
Last active November 5, 2019 06:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahuls360/cf1a3f2d3b09fdb01b889b1ba7fed810 to your computer and use it in GitHub Desktop.
Save rahuls360/cf1a3f2d3b09fdb01b889b1ba7fed810 to your computer and use it in GitHub Desktop.
tailwind-css grid only (flex)
module.exports = {
prefix: '',
important: false,
separator: ':',
theme: {
screens: {
sm: '640px',
md: '768px',
lg: '1024px',
xl: '1280px',
},
flex: {
'1': '1 1 0%',
auto: '1 1 auto',
initial: '0 1 auto',
none: 'none',
},
flexGrow: {
'0': '0',
default: '1',
},
flexShrink: {
'0': '0',
default: '1',
},
objectPosition: {
bottom: 'bottom',
center: 'center',
left: 'left',
'left-bottom': 'left bottom',
'left-top': 'left top',
right: 'right',
'right-bottom': 'right bottom',
'right-top': 'right top',
top: 'top',
},
order: {
first: '-9999',
last: '9999',
none: '0',
'1': '1',
'2': '2',
'3': '3',
'4': '4',
'5': '5',
'6': '6',
'7': '7',
'8': '8',
'9': '9',
'10': '10',
'11': '11',
'12': '12',
},
width: theme => ({
auto: 'auto',
...theme('spacing'),
'1/2': '50%',
'1/3': '33.333333%',
'2/3': '66.666667%',
'1/4': '25%',
'2/4': '50%',
'3/4': '75%',
'1/5': '20%',
'2/5': '40%',
'3/5': '60%',
'4/5': '80%',
'1/6': '16.666667%',
'2/6': '33.333333%',
'3/6': '50%',
'4/6': '66.666667%',
'5/6': '83.333333%',
'1/12': '8.333333%',
'2/12': '16.666667%',
'3/12': '25%',
'4/12': '33.333333%',
'5/12': '41.666667%',
'6/12': '50%',
'7/12': '58.333333%',
'8/12': '66.666667%',
'9/12': '75%',
'10/12': '83.333333%',
'11/12': '91.666667%',
full: '100%',
screen: '100vw',
}),
},
variants: {
alignContent: ['responsive'],
alignItems: ['responsive'],
alignSelf: ['responsive'],
appearance: ['responsive'],
display: ['responsive'],
flex: ['responsive'],
flexDirection: ['responsive'],
flexGrow: ['responsive'],
flexShrink: ['responsive'],
flexWrap: ['responsive'],
justifyContent: ['responsive'],
order: ['responsive'],
verticalAlign: ['responsive'],
width: ['responsive'],
},
corePlugins: {
preflight: false,
appearance: false,
backgroundAttachment: false,
backgroundColor: false,
backgroundPosition: false,
backgroundRepeat: false,
backgroundSize: false,
borderCollapse: false,
borderColor: false,
borderRadius: false,
borderStyle: false,
borderWidth: false,
boxShadow: false,
cursor: false,
fill: false,
float: false,
fontFamily: false,
fontSize: false,
fontSmoothing: false,
fontStyle: false,
fontWeight: false,
height: false,
inset: false,
letterSpacing: false,
lineHeight: false,
listStylePosition: false,
listStyleType: false,
margin: false,
maxHeight: false,
maxWidth: false,
minHeight: false,
minWidth: false,
negativeMargin: false,
objectFit: false,
objectPosition: false,
opacity: false,
outline: false,
overflow: false,
padding: false,
placeholderColor: false,
pointerEvents: false,
position: false,
resize: false,
stroke: false,
tableLayout: false,
textAlign: false,
textColor: false,
textDecoration: false,
textTransform: false,
userSelect: false,
whitespace: false,
wordBreak: false,
zIndex: false,
},
plugins: [],
}
@rahuls360
Copy link
Author

Generated the entire tailwind config using npx tailwind init -full
My main intention is to use only the grids, therefore removed things I felt I don't require.
~900 KB -> ~35 KB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment