Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add svh, lvh, and dvh values to default theme #11317

Merged
merged 2 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Use `lightningcss` for nesting and vendor prefixes in PostCSS plugin ([#10399](https://github.com/tailwindlabs/tailwindcss/pull/10399))
- Automatically detect content paths when no `content` configuration is provided ([#11173](https://github.com/tailwindlabs/tailwindcss/pull/11173), [#11221](https://github.com/tailwindlabs/tailwindcss/pull/11221))
- Process and inline `@import` at-rules natively ([#11239](https://github.com/tailwindlabs/tailwindcss/pull/11239))
- Add `svh`, `lvh`, and `dvh` values to default `height`/`min-height`/`max-height` theme ([#11317](https://github.com/tailwindlabs/tailwindcss/pull/11317))

### Changed

Expand Down
12 changes: 12 additions & 0 deletions stubs/config.full.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,9 @@ module.exports = {
'5/6': '83.333333%',
full: '100%',
screen: '100vh',
svh: '100svh',
lvh: '100lvh',
dvh: '100dvh',
min: 'min-content',
max: 'max-content',
fit: 'fit-content',
Expand Down Expand Up @@ -621,6 +624,9 @@ module.exports = {
none: 'none',
full: '100%',
screen: '100vh',
svh: '100svh',
lvh: '100lvh',
dvh: '100dvh',
min: 'min-content',
max: 'max-content',
fit: 'fit-content',
Expand Down Expand Up @@ -650,6 +656,9 @@ module.exports = {
0: '0px',
full: '100%',
screen: '100vh',
svh: '100svh',
lvh: '100lvh',
dvh: '100dvh',
min: 'min-content',
max: 'max-content',
fit: 'fit-content',
Expand Down Expand Up @@ -967,6 +976,9 @@ module.exports = {
'11/12': '91.666667%',
full: '100%',
screen: '100vw',
svw: '100svw',
lvw: '100lvw',
dvw: '100dvw',
Comment on lines +979 to +981

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused, it this wanted?

min: 'min-content',
max: 'max-content',
fit: 'fit-content',
Expand Down
45 changes: 45 additions & 0 deletions tests/basic-usage.test.css
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,60 @@
.aspect-video {
aspect-ratio: 16 / 9;
}
.h-0 {
height: 0;
}
.h-16 {
height: 4rem;
}
.h-dvh {
height: 100dvh;
}
.h-full {
height: 100%;
}
.h-lvh {
height: 100lvh;
}
.h-screen {
height: 100vh;
}
.h-svh {
height: 100svh;
}
.max-h-0 {
max-height: 0;
}
.max-h-dvh {
max-height: 100dvh;
}
.max-h-full {
max-height: 100%;
}
.max-h-lvh {
max-height: 100lvh;
}
.max-h-screen {
max-height: 100vh;
}
.max-h-svh {
max-height: 100svh;
}
.min-h-0 {
min-height: 0;
}
.min-h-dvh {
min-height: 100dvh;
}
.min-h-full {
min-height: 100%;
}
.min-h-lvh {
min-height: 100lvh;
}
.min-h-svh {
min-height: 100svh;
}
.w-12 {
width: 3rem;
}
Expand Down
5 changes: 3 additions & 2 deletions tests/basic-usage.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,10 @@ test('basic usage', () => {
<div class="list-disc"></div>
<div class="list-image-none"></div>
<div class="m-4 my-2 mx-auto mt-0 mr-1 mb-3 ml-4"></div>
<div class="max-h-screen"></div>
<div class="h-0 h-full h-screen h-svh h-lvh h-dvh"></div>
<div class="max-h-0 max-h-full max-h-screen max-h-svh max-h-lvh max-h-dvh"></div>
<div class="max-w-full"></div>
<div class="min-h-0"></div>
<div class="min-h-0 min-h-full min-h-0 min-h-svh min-h-lvh min-h-dvh"></div>
<div class="min-w-min"></div>
<div class="object-cover"></div>
<div class="object-bottom"></div>
Expand Down