Skip to content

Commit 7ed46b6

Browse files
committed
Re-enable new features
This reverts commits 1456ed9, d0269c2, and 57699a0.
1 parent 23a6d3f commit 7ed46b6

24 files changed

+134
-80
lines changed

CHANGELOG.md

+14
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Nothing yet!
2626
- Fix generation of `div:not(.foo)` if `.foo` is never defined ([#7815](https://github.com/tailwindlabs/tailwindcss/pull/7815))
2727
- Allow for custom properties in `rgb`, `rgba`, `hsl` and `hsla` colors ([#7933](https://github.com/tailwindlabs/tailwindcss/pull/7933))
2828
- Remove autoprefixer as explicit peer-dependency to avoid invalid warnings in situations where it isn't actually needed ([#7949](https://github.com/tailwindlabs/tailwindcss/pull/7949))
29+
- Types: allow for arbitrary theme values (for 3rd party plugins) ([#7926](https://github.com/tailwindlabs/tailwindcss/pull/7926))
2930
- Ensure the `percentage` data type is validated correctly ([#8015](https://github.com/tailwindlabs/tailwindcss/pull/8015))
3031

3132
### Changed
@@ -34,6 +35,19 @@ Nothing yet!
3435
- Replace `cosmiconfig` with `lilconfig` ([#6039](https://github.com/tailwindlabs/tailwindcss/pull/6038))
3536
- Update `cssnano` to avoid removing empty variables when minifying ([#7818](https://github.com/tailwindlabs/tailwindcss/pull/7818))
3637

38+
### Added
39+
40+
- Allow default ring color to be a function ([#7587](https://github.com/tailwindlabs/tailwindcss/pull/7587))
41+
- Add `rgb` and `hsl` color helpers for CSS variables ([#7665](https://github.com/tailwindlabs/tailwindcss/pull/7665))
42+
- Support PostCSS `Document` nodes ([#7291](https://github.com/tailwindlabs/tailwindcss/pull/7291))
43+
- Add `text-start` and `text-end` utilities ([#6656](https://github.com/tailwindlabs/tailwindcss/pull/6656))
44+
- Support customizing class name when using `darkMode: 'class'` ([#5800](https://github.com/tailwindlabs/tailwindcss/pull/5800))
45+
- Add `--poll` option to the CLI ([#7725](https://github.com/tailwindlabs/tailwindcss/pull/7725))
46+
- Add new `border-spacing` utilities ([#7102](https://github.com/tailwindlabs/tailwindcss/pull/7102))
47+
- Add `enabled` variant ([#7905](https://github.com/tailwindlabs/tailwindcss/pull/7905))
48+
- Add TypeScript types for the `tailwind.config.js` file ([#7891](https://github.com/tailwindlabs/tailwindcss/pull/7891))
49+
- Add `backdrop` variant ([#7924](https://github.com/tailwindlabs/tailwindcss/pull/7924))
50+
3751
## [3.0.23] - 2022-02-16
3852

3953
### Fixed

integrations/tailwindcss-cli/tests/cli.test.js

+1
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ describe('Build command', () => {
291291
-i, --input Input file
292292
-o, --output Output file
293293
-w, --watch Watch for changes and rebuild as needed
294+
-p, --poll Use polling instead of filesystem events when watching
294295
--content Content paths to use for removing unused classes
295296
--postcss Load custom PostCSS configuration
296297
-m, --minify Minify the output

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"description": "A utility-first CSS framework for rapidly building custom user interfaces.",
55
"license": "MIT",
66
"main": "lib/index.js",
7+
"types": "types/index.d.ts",
78
"repository": "https://github.com/tailwindlabs/tailwindcss.git",
89
"bugs": "https://github.com/tailwindlabs/tailwindcss/issues",
910
"homepage": "https://tailwindcss.com",
@@ -25,7 +26,7 @@
2526
"posttest": "npm run style",
2627
"generate:plugin-list": "node -r @swc/register scripts/create-plugin-list.js",
2728
"generate:types": "node -r @swc/register scripts/generate-types.js",
28-
"generate": "npm run generate:plugin-list"
29+
"generate": "npm run generate:plugin-list && npm run generate:types"
2930
},
3031
"files": [
3132
"src/*",
@@ -35,6 +36,8 @@
3536
"scripts/*.js",
3637
"stubs/*.stub.js",
3738
"nesting/*",
39+
"types/**/*",
40+
"*.d.ts",
3841
"*.css",
3942
"*.js"
4043
],

src/cli.js

-7
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,10 @@ let commands = {
165165
'--input': { type: String, description: 'Input file' },
166166
'--output': { type: String, description: 'Output file' },
167167
'--watch': { type: Boolean, description: 'Watch for changes and rebuild as needed' },
168-
/*
169168
'--poll': {
170169
type: Boolean,
171170
description: 'Use polling instead of filesystem events when watching',
172171
},
173-
*/
174172
'--content': {
175173
type: String,
176174
description: 'Content paths to use for removing unused classes',
@@ -197,9 +195,7 @@ let commands = {
197195
'-o': '--output',
198196
'-m': '--minify',
199197
'-w': '--watch',
200-
/*
201198
'-p': '--poll',
202-
*/
203199
},
204200
},
205201
}
@@ -387,10 +383,7 @@ async function build() {
387383
let input = args['--input']
388384
let output = args['--output']
389385
let shouldWatch = args['--watch']
390-
let shouldPoll = false
391-
/*
392386
let shouldPoll = args['--poll']
393-
*/
394387
let shouldCoalesceWriteEvents = shouldPoll || process.platform === 'win32'
395388
let includePostCss = args['--postcss']
396389

src/corePlugins.js

+1-15
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ export let variantPlugins = {
2727

2828
addVariant('placeholder', '&::placeholder')
2929

30-
/*
3130
addVariant('backdrop', '&::backdrop')
32-
*/
3331

3432
addVariant('before', ({ container }) => {
3533
container.walkRules((rule) => {
@@ -122,9 +120,7 @@ export let variantPlugins = {
122120
'focus',
123121
'focus-visible',
124122
'active',
125-
/*
126123
'enabled',
127-
*/
128124
'disabled',
129125
].map((variant) => (Array.isArray(variant) ? variant : [variant, `:${variant}`]))
130126

@@ -179,7 +175,7 @@ export let variantPlugins = {
179175
},
180176

181177
darkVariants: ({ config, addVariant }) => {
182-
let [mode] = [].concat(config('darkMode', 'media'))
178+
let [mode, className = '.dark'] = [].concat(config('darkMode', 'media'))
183179

184180
if (mode === false) {
185181
mode = 'media'
@@ -191,10 +187,7 @@ export let variantPlugins = {
191187
}
192188

193189
if (mode === 'class') {
194-
addVariant('dark', `.dark &`)
195-
/*
196190
addVariant('dark', `${className} &`)
197-
*/
198191
} else if (mode === 'media') {
199192
addVariant('dark', '@media (prefers-color-scheme: dark)')
200193
}
@@ -539,7 +532,6 @@ export let corePlugins = {
539532
})
540533
},
541534

542-
/*
543535
borderSpacing: ({ addDefaults, matchUtilities, theme }) => {
544536
addDefaults('border-spacing', {
545537
'--tw-border-spacing-x': 0,
@@ -574,7 +566,6 @@ export let corePlugins = {
574566
{ values: theme('borderSpacing') }
575567
)
576568
},
577-
*/
578569

579570
transformOrigin: createUtilityPlugin('transformOrigin', [['origin', ['transformOrigin']]]),
580571
translate: createUtilityPlugin(
@@ -1571,10 +1562,8 @@ export let corePlugins = {
15711562
'.text-center': { 'text-align': 'center' },
15721563
'.text-right': { 'text-align': 'right' },
15731564
'.text-justify': { 'text-align': 'justify' },
1574-
/*
15751565
'.text-start': { 'text-align': 'start' },
15761566
'.text-end': { 'text-align': 'end' },
1577-
*/
15781567
})
15791568
},
15801569

@@ -1978,10 +1967,7 @@ export let corePlugins = {
19781967
ringWidth: ({ matchUtilities, addDefaults, addUtilities, theme }) => {
19791968
let ringOpacityDefault = theme('ringOpacity.DEFAULT', '0.5')
19801969
let ringColorDefault = withAlphaValue(
1981-
/*
19821970
theme('ringColor')?.DEFAULT,
1983-
*/
1984-
theme('ringColor.DEFAULT'),
19851971
ringOpacityDefault,
19861972
`rgb(147 197 253 / ${ringOpacityDefault})`
19871973
)

src/index.js

-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ module.exports = function tailwindcss(configOrPath) {
1515
function (root, result) {
1616
let context = setupTrackingContext(configOrPath)
1717

18-
/*
1918
if (root.type === 'document') {
2019
let roots = root.nodes.filter((node) => node.type === 'root')
2120

@@ -27,7 +26,6 @@ module.exports = function tailwindcss(configOrPath) {
2726

2827
return
2928
}
30-
*/
3129

3230
processTailwindFeatures(context)(root, result)
3331
},

src/util/resolveConfig.js

-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ const configUtils = {
6666
{}
6767
)
6868
},
69-
/*
7069
rgb(property) {
7170
if (!property.startsWith('--')) {
7271
throw new Error(
@@ -97,7 +96,6 @@ const configUtils = {
9796
return `hsl(var(${property}) / ${opacityValue})`
9897
}
9998
},
100-
*/
10199
}
102100

103101
function value(valueToResolve, ...args) {

stubs/defaultConfig.stub.js

-2
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,9 @@ module.exports = {
194194
'3xl': '1.5rem',
195195
full: '9999px',
196196
},
197-
/*
198197
borderSpacing: ({ theme }) => ({
199198
...theme('spacing'),
200199
}),
201-
*/
202200
borderWidth: {
203201
DEFAULT: '1px',
204202
0: '0px',

tests/__snapshots__/source-maps.test.js.snap

+44-42
Original file line numberDiff line numberDiff line change
@@ -268,48 +268,50 @@ Array [
268268
"2:4-18 -> 368:2-15",
269269
"2:18 -> 369:0",
270270
"2:4 -> 371:0",
271-
"2:4-18 -> 372:2-21",
272-
"2:4-18 -> 373:2-21",
273-
"2:4-18 -> 374:2-16",
274-
"2:4-18 -> 375:2-16",
271+
"2:4-18 -> 372:2-26",
272+
"2:4-18 -> 373:2-26",
273+
"2:4-18 -> 374:2-21",
274+
"2:4-18 -> 375:2-21",
275275
"2:4-18 -> 376:2-16",
276-
"2:4-18 -> 377:2-17",
277-
"2:4-18 -> 378:2-17",
278-
"2:4-18 -> 379:2-15",
279-
"2:4-18 -> 380:2-15",
280-
"2:4-18 -> 381:2-20",
281-
"2:4-18 -> 382:2-40",
282-
"2:4-18 -> 383:2-17",
283-
"2:4-18 -> 384:2-22",
284-
"2:4-18 -> 385:2-24",
285-
"2:4-18 -> 386:2-25",
286-
"2:4-18 -> 387:2-26",
287-
"2:4-18 -> 388:2-20",
288-
"2:4-18 -> 389:2-29",
289-
"2:4-18 -> 390:2-30",
290-
"2:4-18 -> 391:2-40",
291-
"2:4-18 -> 392:2-36",
292-
"2:4-18 -> 393:2-29",
293-
"2:4-18 -> 394:2-24",
294-
"2:4-18 -> 395:2-32",
295-
"2:4-18 -> 396:2-14",
296-
"2:4-18 -> 397:2-20",
297-
"2:4-18 -> 398:2-18",
298-
"2:4-18 -> 399:2-19",
299-
"2:4-18 -> 400:2-20",
300-
"2:4-18 -> 401:2-16",
301-
"2:4-18 -> 402:2-18",
302-
"2:4-18 -> 403:2-15",
303-
"2:4-18 -> 404:2-21",
304-
"2:4-18 -> 405:2-23",
305-
"2:4-18 -> 406:2-29",
306-
"2:4-18 -> 407:2-27",
307-
"2:4-18 -> 408:2-28",
308-
"2:4-18 -> 409:2-29",
309-
"2:4-18 -> 410:2-25",
310-
"2:4-18 -> 411:2-26",
311-
"2:4-18 -> 412:2-27",
312-
"2:4 -> 413:2",
313-
"2:18 -> 414:0",
276+
"2:4-18 -> 377:2-16",
277+
"2:4-18 -> 378:2-16",
278+
"2:4-18 -> 379:2-17",
279+
"2:4-18 -> 380:2-17",
280+
"2:4-18 -> 381:2-15",
281+
"2:4-18 -> 382:2-15",
282+
"2:4-18 -> 383:2-20",
283+
"2:4-18 -> 384:2-40",
284+
"2:4-18 -> 385:2-17",
285+
"2:4-18 -> 386:2-22",
286+
"2:4-18 -> 387:2-24",
287+
"2:4-18 -> 388:2-25",
288+
"2:4-18 -> 389:2-26",
289+
"2:4-18 -> 390:2-20",
290+
"2:4-18 -> 391:2-29",
291+
"2:4-18 -> 392:2-30",
292+
"2:4-18 -> 393:2-40",
293+
"2:4-18 -> 394:2-36",
294+
"2:4-18 -> 395:2-29",
295+
"2:4-18 -> 396:2-24",
296+
"2:4-18 -> 397:2-32",
297+
"2:4-18 -> 398:2-14",
298+
"2:4-18 -> 399:2-20",
299+
"2:4-18 -> 400:2-18",
300+
"2:4-18 -> 401:2-19",
301+
"2:4-18 -> 402:2-20",
302+
"2:4-18 -> 403:2-16",
303+
"2:4-18 -> 404:2-18",
304+
"2:4-18 -> 405:2-15",
305+
"2:4-18 -> 406:2-21",
306+
"2:4-18 -> 407:2-23",
307+
"2:4-18 -> 408:2-29",
308+
"2:4-18 -> 409:2-27",
309+
"2:4-18 -> 410:2-28",
310+
"2:4-18 -> 411:2-29",
311+
"2:4-18 -> 412:2-25",
312+
"2:4-18 -> 413:2-26",
313+
"2:4-18 -> 414:2-27",
314+
"2:4 -> 415:2",
315+
"2:18 -> 416:0",
314316
]
315317
`;

tests/basic-usage.test.css

+15
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
*,
22
::before,
33
::after {
4+
--tw-border-spacing-x: 0;
5+
--tw-border-spacing-y: 0;
46
--tw-translate-x: 0;
57
--tw-translate-y: 0;
68
--tw-rotate: 0;
@@ -252,6 +254,19 @@
252254
.border-collapse {
253255
border-collapse: collapse;
254256
}
257+
.border-spacing-4 {
258+
--tw-border-spacing-x: 1rem;
259+
--tw-border-spacing-y: 1rem;
260+
border-spacing: var(--tw-border-spacing-x) var(--tw-border-spacing-y);
261+
}
262+
.border-spacing-x-6 {
263+
--tw-border-spacing-x: 1.5rem;
264+
border-spacing: var(--tw-border-spacing-x) var(--tw-border-spacing-y);
265+
}
266+
.border-spacing-y-8 {
267+
--tw-border-spacing-y: 2rem;
268+
border-spacing: var(--tw-border-spacing-x) var(--tw-border-spacing-y);
269+
}
255270
.origin-top-right {
256271
transform-origin: top right;
257272
}

tests/basic-usage.test.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ test('default ring color can be a function', () => {
152152
*,
153153
::before,
154154
::after {
155+
--tw-border-spacing-x: 0;
156+
--tw-border-spacing-y: 0;
155157
--tw-translate-x: 0;
156158
--tw-translate-y: 0;
157159
--tw-rotate: 0;
@@ -171,7 +173,7 @@ test('default ring color can be a function', () => {
171173
--tw-ring-inset: ;
172174
--tw-ring-offset-width: 0px;
173175
--tw-ring-offset-color: #fff;
174-
--tw-ring-color: rgb(147 197 253 / 0.5);
176+
--tw-ring-color: rgba(var(--red), 0.5);
175177
--tw-ring-offset-shadow: 0 0 #0000;
176178
--tw-ring-shadow: 0 0 #0000;
177179
--tw-shadow: 0 0 #0000;

tests/collapse-adjacent-rules.test.css

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
*,
1111
::before,
1212
::after {
13+
--tw-border-spacing-x: 0;
14+
--tw-border-spacing-y: 0;
1315
--tw-translate-x: 0;
1416
--tw-translate-y: 0;
1517
--tw-rotate: 0;

tests/dark-mode.test.js

-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ it('should be possible to use the darkMode "class" mode', () => {
2323
})
2424
})
2525

26-
/*
2726
it('should be possible to change the class name', () => {
2827
let config = {
2928
darkMode: ['class', '.test-dark'],
@@ -46,7 +45,6 @@ it('should be possible to change the class name', () => {
4645
`)
4746
})
4847
})
49-
*/
5048

5149
it('should be possible to use the darkMode "media" mode', () => {
5250
let config = {

tests/import-syntax.test.css

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ h1 {
44
*,
55
::before,
66
::after {
7+
--tw-border-spacing-x: 0;
8+
--tw-border-spacing-y: 0;
79
--tw-translate-x: 0;
810
--tw-translate-y: 0;
911
--tw-rotate: 0;

0 commit comments

Comments
 (0)