Skip to content

Commit 8b802c0

Browse files
committed
docs(upgrade-guide): snippets for fixing visual regression
1 parent 9bf8d37 commit 8b802c0

1 file changed

Lines changed: 55 additions & 3 deletions

File tree

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

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,64 @@ This page contains a detailed list of breaking changes and the steps required to
1919

2020
## Styles
2121

22+
### Style entry points
23+
2224
There are now pre-compiled entry points for the most common style changes. If you have a Sass file that only sets `$color-pack: false` or `$utilities: false` you can replace it with `import 'vuetify/styles/core'`. See [Style entry points](/styles/entry-points) for more information.
2325

24-
The CSS reset has been mostly removed, with style normalisation being moved to individual components instead.
26+
### CSS reset
27+
28+
The CSS reset has been mostly removed, with style normalisation being moved to individual components instead. You can inspect the exact [changes](https://github.com/vuetifyjs/vuetify/pull/20960/changes#diff-87996fc432835581ad883bedbc1975ad3a3f44b5747b2b831e3fa03dfdabb91f) to learn more. Here is the high level overview:
29+
30+
- global `* { padding: 0; margin: 0; }` is gone - no longer resets all elements
31+
- `<button>`, `<input>`, `<select>` have their browser-native borders and background colors.
2532

26-
- `<button>`, `<input>`, `<select>` have their browser native borders and background colors.
27-
- `<ul>`, `<ol>` and headings have padding and margins.
33+
If you notice browser styles adding unnecessary spaces and impact text size, it is recommended to assess the scope of visual regression and selectively apply spacing resets:
34+
35+
```css
36+
ul, ol, figure, details, summary {
37+
padding: 0;
38+
margin: 0;
39+
}
40+
41+
h1, h2, h3, h4, h5, h6 {
42+
margin: 0;
43+
}
44+
```
45+
46+
Restoring most of the previous reset styles would be heavy-handed, but will get the job done as well.
47+
48+
```css
49+
* { padding: 0; margin: 0; }
50+
a:active, a:hover { outline-width: 0; }
51+
code, kbd, pre, samp { font-family: monospace; }
52+
pre { font-size: 1em; }
53+
small { font-size: 80%; }
54+
sub, sup {
55+
font-size: 75%;
56+
line-height: 0;
57+
position: relative;
58+
vertical-align: baseline;
59+
}
60+
sub { bottom: -0.25em; }
61+
sup { top: -0.5em; }
62+
textarea { resize: vertical; }
63+
button,
64+
input,
65+
select,
66+
textarea {
67+
background-color: transparent;
68+
border-style: none;
69+
}
70+
select {
71+
-moz-appearance: none;
72+
-webkit-appearance: none;
73+
}
74+
legend {
75+
display: table;
76+
max-width: 100%;
77+
white-space: normal;
78+
}
79+
```
2880

2981
### Layers
3082

0 commit comments

Comments
 (0)