tailwindcss 4.0.0-alpha.8 → 4.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "tailwindcss",
3
- "version": "4.0.0-alpha.8",
3
+ "version": "4.0.0-beta.1",
4
4
  "description": "A utility-first CSS framework for rapidly building custom user interfaces.",
5
5
  "license": "MIT",
6
- "repository": "https://github.com/tailwindlabs/tailwindcss.git",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/tailwindlabs/tailwindcss.git",
9
+ "directory": "packages/tailwindcss"
10
+ },
7
11
  "bugs": "https://github.com/tailwindlabs/tailwindcss/issues",
8
12
  "homepage": "https://tailwindcss.com",
9
13
  "exports": {
@@ -13,6 +17,30 @@
13
17
  "require": "./dist/lib.js",
14
18
  "import": "./dist/lib.mjs"
15
19
  },
20
+ "./plugin": {
21
+ "require": "./dist/plugin.js",
22
+ "import": "./dist/plugin.mjs"
23
+ },
24
+ "./plugin.js": {
25
+ "require": "./dist/plugin.js",
26
+ "import": "./dist/plugin.mjs"
27
+ },
28
+ "./defaultTheme": {
29
+ "require": "./dist/default-theme.js",
30
+ "import": "./dist/default-theme.mjs"
31
+ },
32
+ "./defaultTheme.js": {
33
+ "require": "./dist/default-theme.js",
34
+ "import": "./dist/default-theme.mjs"
35
+ },
36
+ "./colors": {
37
+ "require": "./dist/colors.js",
38
+ "import": "./dist/colors.mjs"
39
+ },
40
+ "./colors.js": {
41
+ "require": "./dist/colors.js",
42
+ "import": "./dist/colors.mjs"
43
+ },
16
44
  "./package.json": "./package.json",
17
45
  "./index.css": "./index.css",
18
46
  "./index": "./index.css",
@@ -35,12 +63,11 @@
35
63
  "theme.css",
36
64
  "utilities.css"
37
65
  ],
38
- "dependencies": {
39
- "lightningcss": "^1.24.0"
40
- },
41
66
  "devDependencies": {
42
- "@types/node": "^20.10.8",
43
- "@tailwindcss/oxide": "4.0.0-alpha.8"
67
+ "@types/node": "^20.14.8",
68
+ "lightningcss": "^1.26.0",
69
+ "dedent": "1.5.3",
70
+ "@tailwindcss/oxide": "4.0.0-beta.1"
44
71
  },
45
72
  "scripts": {
46
73
  "lint": "tsc --noEmit",
package/preflight.css CHANGED
@@ -8,7 +8,6 @@
8
8
  ::after,
9
9
  ::before,
10
10
  ::backdrop,
11
- ::first-letter,
12
11
  ::file-selector-button {
13
12
  box-sizing: border-box; /* 1 */
14
13
  margin: 0; /* 2 */
@@ -24,6 +23,7 @@
24
23
  5. Use the user's configured `sans` font-feature-settings by default.
25
24
  6. Use the user's configured `sans` font-variation-settings by default.
26
25
  7. Disable tap highlights on iOS.
26
+ 8. Set a default `color-scheme`.
27
27
  */
28
28
 
29
29
  html,
@@ -44,6 +44,7 @@ html,
44
44
  font-feature-settings: var(--default-font-feature-settings, normal); /* 5 */
45
45
  font-variation-settings: var(--default-font-variation-settings, normal); /* 6 */
46
46
  -webkit-tap-highlight-color: transparent; /* 7 */
47
+ color-scheme: light; /* 8 */
47
48
  }
48
49
 
49
50
  /*
@@ -176,73 +177,100 @@ table {
176
177
  }
177
178
 
178
179
  /*
179
- 1. Inherit the font styles in all browsers.
180
- 2. Remove the default background color.
180
+ Use the modern Firefox focus style for all focusable elements.
181
181
  */
182
182
 
183
- button,
184
- input,
185
- optgroup,
186
- select,
187
- textarea,
188
- ::file-selector-button {
189
- font: inherit; /* 1 */
190
- font-feature-settings: inherit; /* 1 */
191
- font-variation-settings: inherit; /* 1 */
192
- color: inherit; /* 1 */
193
- background: transparent; /* 2 */
183
+ :-moz-focusring {
184
+ outline: auto;
194
185
  }
195
186
 
196
187
  /*
197
- Reset the default inset border style for form controls to solid.
188
+ Add the correct vertical alignment in Chrome and Firefox.
198
189
  */
199
190
 
200
- input:where(:not([type='button'], [type='reset'], [type='submit'])),
201
- select,
202
- textarea {
203
- border: 1px solid;
191
+ progress {
192
+ vertical-align: baseline;
204
193
  }
205
194
 
206
195
  /*
207
- Correct the inability to style the border radius in iOS Safari.
196
+ Add the correct display in Chrome and Safari.
208
197
  */
209
- button,
210
- input:where([type='button'], [type='reset'], [type='submit']),
211
- ::file-selector-button {
212
- appearance: button;
198
+
199
+ summary {
200
+ display: list-item;
213
201
  }
214
202
 
215
203
  /*
216
- Use the modern Firefox focus style for all focusable elements.
204
+ Make lists unstyled by default.
217
205
  */
218
206
 
219
- :-moz-focusring {
220
- outline: auto;
207
+ ol,
208
+ ul,
209
+ menu {
210
+ list-style: none;
221
211
  }
222
212
 
223
213
  /*
224
- Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
214
+ 1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
215
+ 2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
216
+ This can trigger a poorly considered lint error in some tools but is included by design.
225
217
  */
226
218
 
227
- :-moz-ui-invalid {
228
- box-shadow: none;
219
+ img,
220
+ svg,
221
+ video,
222
+ canvas,
223
+ audio,
224
+ iframe,
225
+ embed,
226
+ object {
227
+ display: block; /* 1 */
228
+ vertical-align: middle; /* 2 */
229
229
  }
230
230
 
231
231
  /*
232
- Add the correct vertical alignment in Chrome and Firefox.
232
+ Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
233
233
  */
234
234
 
235
- progress {
236
- vertical-align: baseline;
235
+ img,
236
+ video {
237
+ max-width: 100%;
238
+ height: auto;
237
239
  }
238
240
 
239
241
  /*
240
- Correct the cursor style of increment and decrement buttons in Safari.
242
+ Inherit font styles in all browsers.
241
243
  */
242
244
 
243
- ::-webkit-inner-spin-button,
244
- ::-webkit-outer-spin-button {
245
- height: auto;
245
+ button,
246
+ input,
247
+ select,
248
+ optgroup,
249
+ textarea,
250
+ ::file-selector-button {
251
+ font: inherit;
252
+ font-feature-settings: inherit;
253
+ font-variation-settings: inherit;
254
+ letter-spacing: inherit;
255
+ color: inherit;
256
+ }
257
+
258
+ /*
259
+ 1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
260
+ 2. Set the default placeholder color to a semi-transparent version of the current text color.
261
+ */
262
+
263
+ ::placeholder {
264
+ opacity: 1; /* 1 */
265
+ color: color-mix(in oklch, currentColor 50%, transparent); /* 2 */
266
+ }
267
+
268
+ /*
269
+ Prevent resizing textareas horizontally by default.
270
+ */
271
+
272
+ textarea {
273
+ resize: vertical;
246
274
  }
247
275
 
248
276
  /*
@@ -254,81 +282,181 @@ progress {
254
282
  }
255
283
 
256
284
  /*
257
- Add the correct display in Chrome and Safari.
285
+ 1. Ensure date/time inputs have the same height when empty in iOS Safari.
286
+ 2. Ensure text alignment can be changed on date/time inputs in iOS Safari.
258
287
  */
259
288
 
260
- summary {
261
- display: list-item;
289
+ ::-webkit-date-and-time-value {
290
+ min-height: 1lh; /* 1 */
291
+ text-align: inherit; /* 2 */
262
292
  }
263
293
 
264
294
  /*
265
- Make lists unstyled by default.
295
+ Prevent height from changing on date/time inputs in macOS Safari when the input is set to `display: block`.
266
296
  */
267
297
 
268
- ol,
269
- ul,
270
- menu {
271
- list-style: none;
298
+ ::-webkit-datetime-edit {
299
+ display: inline-flex;
272
300
  }
273
301
 
274
302
  /*
275
- Prevent resizing textareas horizontally by default.
303
+ Remove excess padding from pseudo-elements in date/time inputs to ensure consistent height across browsers.
276
304
  */
277
305
 
278
- textarea {
279
- resize: vertical;
306
+ ::-webkit-datetime-edit-fields-wrapper {
307
+ padding: 0;
308
+ }
309
+
310
+ ::-webkit-datetime-edit,
311
+ ::-webkit-datetime-edit-year-field,
312
+ ::-webkit-datetime-edit-month-field,
313
+ ::-webkit-datetime-edit-day-field,
314
+ ::-webkit-datetime-edit-hour-field,
315
+ ::-webkit-datetime-edit-minute-field,
316
+ ::-webkit-datetime-edit-second-field,
317
+ ::-webkit-datetime-edit-millisecond-field,
318
+ ::-webkit-datetime-edit-meridiem-field {
319
+ padding-block: 0;
280
320
  }
281
321
 
282
322
  /*
283
- 1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
284
- 2. Set the default placeholder color to a semi-transparent version of the current text color.
323
+ Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
285
324
  */
286
325
 
287
- ::placeholder {
288
- opacity: 1; /* 1 */
289
- color: color-mix(in srgb, currentColor 50%, transparent); /* 2 */
326
+ :-moz-ui-invalid {
327
+ box-shadow: none;
290
328
  }
291
329
 
292
330
  /*
293
- Make sure disabled buttons don't get the pointer cursor.
331
+ Correct the inability to style the border radius in iOS Safari.
294
332
  */
295
333
 
296
- :disabled {
297
- cursor: default;
334
+ button,
335
+ input:where([type='button'], [type='reset'], [type='submit']),
336
+ ::file-selector-button {
337
+ appearance: button;
298
338
  }
299
339
 
300
340
  /*
301
- 1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
302
- 2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
303
- This can trigger a poorly considered lint error in some tools but is included by design.
341
+ Correct the cursor style of increment and decrement buttons in Safari.
304
342
  */
305
343
 
306
- img,
307
- svg,
308
- video,
309
- canvas,
310
- audio,
311
- iframe,
312
- embed,
313
- object {
314
- display: block; /* 1 */
315
- vertical-align: middle; /* 2 */
344
+ ::-webkit-inner-spin-button,
345
+ ::-webkit-outer-spin-button {
346
+ height: auto;
316
347
  }
317
348
 
318
349
  /*
319
- Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
350
+ Apply consistent base form control styles across browsers.
320
351
  */
321
352
 
322
- img,
323
- video {
324
- max-width: 100%;
325
- height: auto;
353
+ select,
354
+ textarea,
355
+ input:where(
356
+ [type='text'],
357
+ [type='email'],
358
+ [type='password'],
359
+ [type='date'],
360
+ [type='datetime-local'],
361
+ [type='month'],
362
+ [type='number'],
363
+ [type='search'],
364
+ [type='time'],
365
+ [type='week'],
366
+ [type='tel'],
367
+ [type='url']
368
+ ) {
369
+ border-radius: 3px;
370
+ padding-inline: 4px;
371
+ padding-block: 2px;
372
+ color: light-dark(black, white);
373
+ background-color: light-dark(white, rgb(255 255 255 / 10%));
374
+ border: 1px solid light-dark(rgb(0 0 0 / 50%), rgb(255 255 255 / 25%));
375
+ }
376
+
377
+ :where(select:not([multiple], [size])) option,
378
+ :where(select:not([multiple], [size])) optgroup {
379
+ color: FieldText;
380
+ background-color: Field;
381
+ }
382
+
383
+ :where(select:is([multiple], [size])) optgroup {
384
+ font-weight: bold;
385
+ }
386
+
387
+ :where(select:is([multiple], [size])) optgroup option {
388
+ padding-inline-start: 20px;
389
+ }
390
+
391
+ select:where(:disabled),
392
+ textarea:where(:disabled),
393
+ input:where(
394
+ [type='text'],
395
+ [type='email'],
396
+ [type='password'],
397
+ [type='date'],
398
+ [type='datetime-local'],
399
+ [type='month'],
400
+ [type='number'],
401
+ [type='search'],
402
+ [type='time'],
403
+ [type='week'],
404
+ [type='tel'],
405
+ [type='url']
406
+ ):where(:disabled) {
407
+ opacity: 1;
408
+ color: light-dark(rgb(0 0 0 / 50%), rgb(255 255 255 / 50%));
409
+ background-color: light-dark(rgb(0 0 0 / 2.5%), rgb(255 255 255 / 10%));
410
+ border-color: light-dark(rgb(0 0 0 / 20%), rgb(255 255 255 / 15%));
411
+ }
412
+
413
+ /*
414
+ Apply consistent base button styles across browsers.
415
+ */
416
+
417
+ button,
418
+ ::file-selector-button,
419
+ input:where([type='button'], [type='reset'], [type='submit']) {
420
+ border-radius: 4px;
421
+ padding-inline: 4px;
422
+ padding-block: 2px;
423
+ color: light-dark(#000, #fff);
424
+ background-color: light-dark(rgb(0 0 0 / 5%), rgb(255 255 255 / 40%));
425
+ border: 1px solid light-dark(rgb(0 0 0 / 50%), rgb(255 255 255 / 10%));
426
+ }
427
+
428
+ button:where(:hover),
429
+ ::file-selector-button:where(:hover),
430
+ input:where([type='button'], [type='reset'], [type='submit']):where(:hover) {
431
+ background-color: light-dark(rgb(0 0 0 / 10%), rgb(255 255 255 / 45%));
432
+ }
433
+
434
+ button:where(:active),
435
+ ::file-selector-button:where(:active),
436
+ input:where([type='button'], [type='reset'], [type='submit']):where(:active) {
437
+ background-color: light-dark(rgb(0 0 0 / 2.5%), rgb(255 255 255 / 30%));
438
+ }
439
+
440
+ button:where(:disabled),
441
+ :where(input:disabled)::file-selector-button,
442
+ input:where([type='button'], [type='reset'], [type='submit']):where(:disabled) {
443
+ opacity: 1;
444
+ background-color: light-dark(rgb(0 0 0 / 2.5%), rgb(255 255 255 / 25%));
445
+ border-color: light-dark(rgb(0 0 0 / 20%), rgb(255 255 255 / 10%));
446
+ }
447
+
448
+ input:where([type='file']:disabled) {
449
+ color: light-dark(rgb(0 0 0 / 50%), rgb(255 255 255 / 50%));
450
+ }
451
+
452
+ ::file-selector-button {
453
+ margin-inline-end: 4px;
326
454
  }
327
455
 
328
456
  /*
329
457
  Make elements with the HTML hidden attribute stay hidden by default.
330
458
  */
331
459
 
332
- [hidden] {
460
+ [hidden]:where(:not([hidden='until-found'])) {
333
461
  display: none !important;
334
462
  }