Skip to content

Commit ae3e8c9

Browse files
authored
feat(styles): cut down CSS reset (#20960)
closes #17633
1 parent 404a43d commit ae3e8c9

14 files changed

Lines changed: 89 additions & 252 deletions

File tree

packages/docs/src/App.vue

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -169,24 +169,13 @@
169169
a:not(:hover)
170170
text-decoration: none
171171
172-
p
173-
margin-bottom: 1rem
174-
line-height: 1.8
172+
h1 + p
173+
font-size: 1.25rem
174+
font-weight: 300
175+
margin-top: 0
175176
176-
a, a:visited
177-
color: rgb(var(--v-theme-primary))
178-
179-
h1
180-
+ p
181-
font-size: 1.25rem
182-
font-weight: 300
183-
184-
ul:not([class]),
185-
ol:not([class])
186-
padding-left: 20px
187-
188-
ul:not([class]):not(li > ul)
189-
margin-bottom: 16px
177+
p :is(a, a:visited)
178+
color: rgb(var(--v-theme-primary))
190179
191180
// Theme transition
192181
.app-copy

packages/docs/src/components/PageFeatures.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="mb-4">
2+
<div>
33
<page-feature-chip
44
v-if="!isGeneratedPage"
55
:href="contribute"

packages/docs/src/components/app/Toc.vue

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -212,20 +212,23 @@
212212
</script>
213213

214214
<style lang="sass" scoped>
215-
#app-toc
216-
ul
217-
list-style-type: none
215+
@layer vuetify.overrides
216+
#app-toc
217+
ul
218+
list-style-type: none
219+
margin: 0
220+
padding: 0
218221
219-
li
220-
border-left: 2px solid rgb(var(--v-theme-on-surface-variant))
222+
li
223+
border-left: 2px solid rgb(var(--v-theme-on-surface-variant))
221224
222-
&.router-link-active
223-
border-left-color: currentColor
225+
&.router-link-active
226+
border-left-color: currentColor
224227
225-
.v-toc-link
226-
color: inherit
228+
.v-toc-link
229+
color: inherit
227230
228-
:deep(.v-navigation-drawer__content)
229-
height: auto
230-
margin-right: 12px
231+
:deep(.v-navigation-drawer__content)
232+
height: auto
233+
margin-right: 12px
231234
</style>

packages/docs/src/pages/en/getting-started/upgrade-guide.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ This page contains a detailed list of breaking changes and the steps required to
2020
## Styles
2121

2222
- Cascade layers are now being used everywhere. If you have other styles that are not using `@layer` they will now always take priority over vuetify.
23+
- The CSS reset has been mostly removed, with style normalisation being moved to individual components instead.
24+
- `<button>`, `<input>`, `<select>` have their browser native borders and background colors.
25+
- `<ul>`, `<ol>` and headings have padding and margins.
2326

2427
## Themes
2528

packages/vuetify/src/components/VAlert/VAlert.sass

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@
8484
grid-area: content
8585
overflow: hidden
8686

87+
> :first-child
88+
margin-top: 0
89+
90+
> :last-child
91+
margin-bottom: 0
92+
8793
.v-alert__append,
8894
.v-alert__close
8995
margin-inline-start: $alert-append-margin-inline-start

packages/vuetify/src/components/VChip/VChip.sass

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@
5858
display: inline-flex
5959

6060
.v-chip__close
61+
padding: 0
62+
margin: 0
63+
font: inherit
64+
overflow: visible
65+
text-transform: none
66+
background-color: transparent
67+
border-style: none
68+
color: inherit
6169
cursor: pointer
6270
flex: 0 1 auto
6371
font-size: $chip-close-size

packages/vuetify/src/components/VColorPicker/VColorPickerEdit.sass

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,19 @@
2222
margin-inline-end: $color-picker-input-margin
2323

2424
input
25+
padding: 0
26+
font: inherit
27+
border-style: none
2528
border-radius: $color-picker-border-radius
26-
margin-bottom: $color-picker-input-margin-bottom
29+
margin: 0 0 $color-picker-input-margin-bottom
2730
min-width: 0
2831
outline: none
2932
text-align: center
3033
width: 100%
3134
height: $color-picker-input-height
3235
background: rgba(var(--v-theme-surface-variant), .2)
3336
color: rgba(var(--v-theme-on-surface))
37+
-moz-appearance: textfield
3438

3539
@media (forced-colors: active)
3640
border-style: solid

packages/vuetify/src/components/VDivider/VDivider.sass

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
color: inherit
77
display: block
88
flex: $divider-flex
9-
height: 0px
10-
max-height: 0px
9+
height: 0
10+
max-height: 0
11+
margin: 0
1112
opacity: $divider-opacity
1213
transition: inherit
1314

packages/vuetify/src/components/VExpansionPanel/VExpansionPanel.sass

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,15 @@
119119
@include tools.elevation(2)
120120

121121
.v-expansion-panel-title
122+
background-color: transparent
123+
border: none
124+
margin: 0
125+
appearance: none
122126
align-items: center
123127
text-align: start
124128
border-radius: inherit
125129
display: flex
130+
font: inherit
126131
font-size: $expansion-panel-title-font-size
127132
line-height: 1
128133
min-height: $expansion-panel-title-min-height

packages/vuetify/src/components/VField/VField.sass

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,13 @@
146146
input
147147
letter-spacing: inherit
148148

149-
@at-root
150-
& input::placeholder,
151-
input#{&}::placeholder,
152-
textarea#{&}::placeholder
149+
@at-root :where(& input, input#{&}, textarea#{&}, select#{&})
150+
background-color: transparent
151+
border-style: none
152+
padding: 0
153+
margin: 0
154+
155+
&::placeholder
153156
color: currentColor
154157
opacity: var(--v-disabled-opacity)
155158

0 commit comments

Comments
 (0)