diff --git a/.changeset/lemon-kiwis-learn.md b/.changeset/lemon-kiwis-learn.md new file mode 100644 index 0000000000..41851e6c4d --- /dev/null +++ b/.changeset/lemon-kiwis-learn.md @@ -0,0 +1,5 @@ +--- +"@primer/view-components": patch +--- + +Add "action" to the list of data attributes that accept multiple values in the `merge_data` helper diff --git a/.changeset/wicked-bananas-tie.md b/.changeset/wicked-bananas-tie.md new file mode 100644 index 0000000000..1809931d7d --- /dev/null +++ b/.changeset/wicked-bananas-tie.md @@ -0,0 +1,5 @@ +--- +'@primer/view-components': patch +--- + +Remove dialog-scrollgutter setting from hot-path, for improved performance diff --git a/app/components/primer/alpha/dialog.pcss b/app/components/primer/alpha/dialog.pcss index 0ab24cdbc4..070bbc5f35 100644 --- a/app/components/primer/alpha/dialog.pcss +++ b/app/components/primer/alpha/dialog.pcss @@ -8,13 +8,27 @@ /* Overlay */ +/* The --dialog-scrollgutter property is used only on the body element to + * simulate scrollbar-gutter:stable. This property is not and should not + * be used elsewhere in the DOM. There is a performance penalty to + * setting inherited properties which can cause a large style recalc to + * occur, so it benefits us to prevent inheritance for this property. + * See https://web.dev/blog/at-property-performance + */ +@property --dialog-scrollgutter { + initial-value: 0; + inherits: false; + syntax: ""; +} + /* - Remove these disables when we can upgrade to the latest version of @primer/stylelint-config. - See: https://github.com/3846masa/stylelint-browser-compat/pull/807 + Remove these no-unsupported-browser-features disables when we can upgrade to the latest + version of @primer/stylelint-config. See: https://github.com/3846masa/stylelint-browser-compat/pull/807 */ /* stylelint-disable-next-line plugin/no-unsupported-browser-features */ body:has(:modal) { + /* stylelint-disable-next-line csstools/value-no-unknown-custom-properties */ padding-right: var(--dialog-scrollgutter) !important; } diff --git a/app/lib/primer/attributes_helper.rb b/app/lib/primer/attributes_helper.rb index 1e39d7215b..d72fe0d6b6 100644 --- a/app/lib/primer/attributes_helper.rb +++ b/app/lib/primer/attributes_helper.rb @@ -4,7 +4,7 @@ module Primer # :nodoc: module AttributesHelper PLURAL_ARIA_ATTRIBUTES = %i[describedby labelledby].freeze - PLURAL_DATA_ATTRIBUTES = %i[target targets].freeze + PLURAL_DATA_ATTRIBUTES = %i[target targets action].freeze def aria(val, system_arguments) system_arguments[:"aria-#{val}"] || system_arguments.dig(:aria, val.to_sym)