Skip to content

Commit

Permalink
feat: make lib compatible with tailwindcss 1.8 (#52)
Browse files Browse the repository at this point in the history
* feat: add font variant utils

* fix: add fontVariantNumeric to default config

* feat: add justify items utils

* feat: add justify self utils

* feat: add place content utils

* feat: add place items utils

* feat: add place self utils

* feat: update the lib with new utils from the cli
  • Loading branch information
muhammadsammy committed Sep 14, 2020
1 parent f749e62 commit 664d2af
Show file tree
Hide file tree
Showing 6 changed files with 281 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"rollup-plugin-terser": "^5.3.0",
"semver": "^7.3.2",
"standard-version": "^8.0.0",
"tailwindcss": "^1.7.6",
"tailwindcss": "^1.8.7",
"ts-jest": "~23.10.0",
"typescript": "^3.1.4"
}
Expand Down
47 changes: 47 additions & 0 deletions src/cli/default-classes/Flexbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,32 @@ const alignContent = [

const alignSelf = ['self-auto', 'self-start', 'self-center', 'self-end', 'self-stretch'];

const placeContent = [
'place-content-start',
'place-content-center',
'place-content-end',
'place-content-between',
'place-content-around',
'place-content-evenly',
'place-content-stretch',
];

const placeItems = [
'place-items-auto',
'place-items-start',
'place-items-center',
'place-items-end',
'place-items-stretch',
];

const placeSelf = [
'place-self-auto',
'place-self-start',
'place-self-center',
'place-self-end',
'place-self-stretch',
];

const justifyContent = [
'justify-start',
'justify-center',
Expand All @@ -22,6 +48,22 @@ const justifyContent = [
'justify-around',
];

const justifyItems = [
'justify-items-auto',
'justify-items-start',
'justify-items-center',
'justify-items-end',
'justify-items-stretch',
];

const justifySelf = [
'justify-self-auto',
'justify-self-start',
'justify-self-center',
'justify-self-end',
'justify-self-stretch',
];

const flex = ['flex-initial', 'flex-1', 'flex-auto', 'flex-none'];

const flexGrow = ['flex-grow', 'flex-grow-0'];
Expand Down Expand Up @@ -52,7 +94,12 @@ export const FlexBox = {
alignItems,
alignContent,
alignSelf,
placeContent,
placeItems,
placeSelf,
justifyContent,
justifyItems,
justifySelf,
flex,
flexGrow,
flexShrink,
Expand Down
13 changes: 13 additions & 0 deletions src/cli/default-classes/Typography.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ const fontWeight = [
'font-black',
];

const fontVariantNumeric = [
'normal-nums',
'ordinal',
'slashed-zero',
'lining-nums',
'oldstyle-nums',
'proportional-nums',
'tabular-nums',
'diagonal-fractions',
'stacked-fractions',
];

const letterSpacing = [
'tracking-tighter',
'tracking-tight',
Expand Down Expand Up @@ -298,6 +310,7 @@ export const Typography = {
fontSmoothing,
fontStyle,
fontWeight,
fontVariantNumeric,
letterSpacing,
lineHeight,
listStyleType,
Expand Down
6 changes: 6 additions & 0 deletions src/cli/utils/defaultTailwindConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -702,11 +702,14 @@ export const defaultVariants: Record<string, string[]> = {
fontFamily: ['responsive'],
fontSize: ['responsive'],
fontSmoothing: ['responsive'],
fontVariantNumeric: ['responsive'],
fontStyle: ['responsive'],
fontWeight: ['responsive', 'hover', 'focus'],
height: ['responsive'],
inset: ['responsive'],
justifyContent: ['responsive'],
justifyItems: ['responsive'],
justifySelf: ['responsive'],
letterSpacing: ['responsive'],
lineHeight: ['responsive'],
listStylePosition: ['responsive'],
Expand All @@ -724,6 +727,9 @@ export const defaultVariants: Record<string, string[]> = {
overflow: ['responsive'],
overscrollBehavior: ['responsive'],
padding: ['responsive'],
placeContent: ['responsive'],
placeItems: ['responsive'],
placeSelf: ['responsive'],
placeholderColor: ['responsive', 'focus'],
placeholderOpacity: ['responsive', 'focus'],
pointerEvents: ['responsive'],
Expand Down
Loading

0 comments on commit 664d2af

Please sign in to comment.