mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Update list of length units (#10100)
* Update length units * Update changelog
This commit is contained in:
parent
c834da4e80
commit
51b6224e6a
@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Prevent invalid arbitrary variant selectors from failing the build ([#10059](https://github.com/tailwindlabs/tailwindcss/pull/10059))
|
||||
- Properly handle subtraction followed by a variable ([#10074](https://github.com/tailwindlabs/tailwindcss/pull/10074))
|
||||
- Fix missing `string[]` in the `theme.dropShadow` types ([#10072](https://github.com/tailwindlabs/tailwindcss/pull/10072))
|
||||
- Update list of length units ([#10100](https://github.com/tailwindlabs/tailwindcss/pull/10100))
|
||||
|
||||
### Changed
|
||||
|
||||
|
||||
@ -77,6 +77,9 @@ export function percentage(value) {
|
||||
return (value.endsWith('%') && number(value.slice(0, -1))) || isCSSFunction(value)
|
||||
}
|
||||
|
||||
// Please refer to MDN when updating this list:
|
||||
// https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units
|
||||
// https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries#container_query_length_units
|
||||
let lengthUnits = [
|
||||
'cm',
|
||||
'mm',
|
||||
@ -90,10 +93,25 @@ let lengthUnits = [
|
||||
'ch',
|
||||
'rem',
|
||||
'lh',
|
||||
'rlh',
|
||||
'vw',
|
||||
'vh',
|
||||
'vmin',
|
||||
'vmax',
|
||||
'vb',
|
||||
'vi',
|
||||
'svw',
|
||||
'svh',
|
||||
'lvw',
|
||||
'lvh',
|
||||
'dvw',
|
||||
'dvh',
|
||||
'cqw',
|
||||
'cqh',
|
||||
'cqi',
|
||||
'cqb',
|
||||
'cqmin',
|
||||
'cqmax',
|
||||
]
|
||||
let lengthUnitsPattern = `(?:${lengthUnits.join('|')})`
|
||||
export function length(value) {
|
||||
|
||||
@ -843,6 +843,9 @@
|
||||
.text-\[2\.23rem\] {
|
||||
font-size: 2.23rem;
|
||||
}
|
||||
.text-\[4cqw\] {
|
||||
font-size: 4cqw;
|
||||
}
|
||||
.text-\[length\:var\(--font-size\)\] {
|
||||
font-size: var(--font-size);
|
||||
}
|
||||
|
||||
@ -284,6 +284,7 @@
|
||||
|
||||
<div class="text-[0]"></div>
|
||||
<div class="text-[2.23rem]"></div>
|
||||
<div class="text-[4cqw]"></div>
|
||||
<div class="text-[length:var(--font-size)]"></div>
|
||||
<div class="text-[angle:var(--angle)]"></div>
|
||||
<div class="text-[min(10vh,100px)]"></div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user