Skip to content

Commit ac0c213

Browse files
committed
Merge branch 'master' into update-theming-docs
2 parents 24ec589 + 5679f6e commit ac0c213

File tree

6 files changed

+108
-9
lines changed

6 files changed

+108
-9
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: CI
22

3-
on: [push]
3+
on: [push, pull_request]
44

55
jobs:
66
build:

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@
4949
"esModuleInterop": true,
5050
"resolveJsonModule": true,
5151
"jsx": "react",
52-
"strictFunctionTypes": true,
5352
"alwaysStrict": true,
54-
"noImplicitThis": true
53+
"noImplicitThis": true,
54+
"noImplicitAny": false,
55+
"strictBindCallApply": false
5556
}
5657
}
5758
},

packages/core/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ interface BaseProviderProps {
7676
const BaseProvider: React.FC<BaseProviderProps> = ({ context, children }) =>
7777
jsx(
7878
EmotionContext.Provider,
79-
{ value: context.theme },
79+
{ value: context.theme! },
8080
jsx(Context.Provider, {
8181
value: context,
8282
children,
@@ -103,7 +103,7 @@ export function ThemeProvider({ theme, children }: ThemeProviderProps) {
103103

104104
const context =
105105
typeof theme === 'function'
106-
? { ...outer, theme: theme(outer.theme) }
106+
? { ...outer, theme: theme(outer.theme!) }
107107
: merge.all<ContextValue>({}, outer, { theme })
108108

109109
return jsx(BaseProvider, { context }, children)

packages/core/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
44
"jsx": "react",
5-
"strict": false
5+
"strict": false,
6+
"strictFunctionTypes": true
67
},
78
"include": ["./src/**/*.ts", "./src/**/*.tsx"]
89
}

packages/docs/src/sidebar.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
- [Getting Started](/getting-started)
2+
- [Getting Started with Gatsby](/getting-started/gatsby)
23
- [Theming](/theming)
34
- [The `sx` Prop](/sx-prop)
45
- [Styling MDX](/styling-mdx)

packages/preset-tailwind/src/index.ts

Lines changed: 99 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ export const colors = {
257257

258258
export const baseFonts = {
259259
sans:
260-
'-apple-system, BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"',
261-
serif: 'Georgia, Cambria, "Times New Roman", Times, serif',
260+
'system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"',
261+
serif: 'Georgia,Cambria,"Times New Roman",Times,serif',
262262
mono: 'Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace',
263263
}
264264

@@ -377,11 +377,12 @@ export const radii = {
377377
none: '0',
378378
sm: '0.125rem',
379379
default: '0.25rem',
380+
md: '0.375rem',
380381
lg: '0.5rem',
381382
full: '9999px',
382383
}
383384

384-
export const sizes = {
385+
const tailwindSpacing = {
385386
px: '1px',
386387
'0': '0',
387388
'1': '0.25rem',
@@ -401,6 +402,9 @@ export const sizes = {
401402
'48': '12rem',
402403
'56': '14rem',
403404
'64': '16rem',
405+
}
406+
407+
const tailwindMaxWidth = {
404408
xs: '20rem',
405409
sm: '24rem',
406410
md: '28rem',
@@ -411,6 +415,9 @@ export const sizes = {
411415
'4xl': '56rem',
412416
'5xl': '64rem',
413417
'6xl': '72rem',
418+
}
419+
420+
const tailwindWidth = {
414421
'1/2': '50%',
415422
'1/3': '33.333333%',
416423
'2/3': '66.666667%',
@@ -437,12 +444,20 @@ export const sizes = {
437444
'9/12': '75%',
438445
'10/12': '83.333333%',
439446
'11/12': '91.666667%',
447+
}
448+
449+
export const sizes = {
450+
...tailwindSpacing,
451+
...tailwindMaxWidth,
452+
...tailwindWidth,
440453
full: '100%',
441454
screenHeight: '100vh',
442455
screenWidth: '100vw',
443456
}
444457

445458
export const shadows = {
459+
xs: '0 0 0 1px rgba(0, 0, 0, 0.05)',
460+
sm: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
446461
default: '0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)',
447462
md: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)',
448463
lg: '0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)',
@@ -535,6 +550,85 @@ export const styles = {
535550
},
536551
}
537552

553+
export const transforms = {
554+
transformOrigin: {
555+
center: 'center',
556+
top: 'top',
557+
'top-right': 'top right',
558+
right: 'right',
559+
'bottom-right': 'bottom right',
560+
bottom: 'bottom',
561+
'bottom-left': 'bottom left',
562+
left: 'left',
563+
'top-left': 'top left',
564+
},
565+
translate: {
566+
...tailwindSpacing,
567+
'-full': '-100%',
568+
'-1/2': '-50%',
569+
'1/2': '50%',
570+
full: '100%',
571+
},
572+
scale: {
573+
'0': '0',
574+
'50': '.5',
575+
'75': '.75',
576+
'90': '.9',
577+
'95': '.95',
578+
'100': '1',
579+
'105': '1.05',
580+
'110': '1.1',
581+
'125': '1.25',
582+
'150': '1.5',
583+
},
584+
rotate: {
585+
'-180': '-180deg',
586+
'-90': '-90deg',
587+
'-45': '-45deg',
588+
'0': '0',
589+
'45': '45deg',
590+
'90': '90deg',
591+
'180': '180deg',
592+
},
593+
skew: {
594+
'-12': '-12deg',
595+
'-6': '-6deg',
596+
'-3': '-3deg',
597+
'0': '0',
598+
'3': '3deg',
599+
'6': '6deg',
600+
'12': '12deg',
601+
},
602+
}
603+
604+
export const transitions = {
605+
property: {
606+
none: 'none',
607+
all: 'all',
608+
default: 'background-color, border-color, color, fill, stroke, opacity, box-shadow, transform',
609+
colors: 'background-color, border-color, color, fill, stroke',
610+
opacity: 'opacity',
611+
shadow: 'box-shadow',
612+
transform: 'transform',
613+
},
614+
timingFunction: {
615+
linear: 'linear',
616+
in: 'cubic-bezier(0.4, 0, 1, 1)',
617+
out: 'cubic-bezier(0, 0, 0.2, 1)',
618+
'in-out': 'cubic-bezier(0.4, 0, 0.2, 1)',
619+
},
620+
duration: {
621+
'75': '75ms',
622+
'100': '100ms',
623+
'150': '150ms',
624+
'200': '200ms',
625+
'300': '300ms',
626+
'500': '500ms',
627+
'700': '700ms',
628+
'1000': '1000ms',
629+
},
630+
}
631+
538632
export const tailwind = {
539633
borderWidths,
540634
breakpoints,
@@ -552,6 +646,8 @@ export const tailwind = {
552646
styles,
553647
buttons,
554648
inputs,
649+
transforms,
650+
transitions,
555651
}
556652

557653
export default tailwind

0 commit comments

Comments
 (0)