File tree 2 files changed +20
-0
lines changed
app/components/primer/alpha
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @primer/view-components ' : patch
3
+ ---
4
+
5
+ Remove dialog-scrollgutter setting from hot-path, for improved performance
Original file line number Diff line number Diff line change 8
8
9
9
/* Overlay */
10
10
11
+ /* The --dialog-scrollgutter property is used only on the body element to
12
+ * simulate scrollbar-gutter:stable. This property is not and should not
13
+ * be used elsewhere in the DOM. There is a performance penalty to
14
+ * setting inherited properties which can cause a large style recalc to
15
+ * occur, so it benefits us to prevent inheritance for this property.
16
+ * See https://web.dev/blog/at-property-performance
17
+ */
18
+ @property --dialog-scrollgutter {
19
+ initial-value : 0 ;
20
+ inherits : false;
21
+ syntax : "<length>" ;
22
+ }
23
+
11
24
/* TODO: One day this can be :has(:modal), when it is better supported */
12
25
body .has-modal {
26
+ /* stylelint-disable-next-line csstools/value-no-unknown-custom-properties */
13
27
padding-right : var (--dialog-scrollgutter ) !important ;
14
28
overflow : hidden !important ;
15
29
}
@@ -350,6 +364,7 @@ dialog.Overlay:not([open]) {
350
364
&:hover ,
351
365
&:focus {
352
366
background-color : var (--button-default-bgColor-hover );
367
+ /* stylelint-disable-next-line primer/colors */
353
368
border : var (--borderWidth-thin ) solid var (--control-bgColor-hover );
354
369
}
355
370
You can’t perform that action at this time.
0 commit comments