Skip to content

Commit

Permalink
build: update Spectrum CSS processing for less errors and better cove…
Browse files Browse the repository at this point in the history
…rage
  • Loading branch information
Westbrook committed Jan 4, 2021
1 parent 925934a commit 8e5ec9b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/action-group/src/spectrum-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const config = {
selector: '.spectrum-ActionGroup-item.focus-ring',
},
],
exclude: [/\.spectrum-ActionButton-label/],
},
],
};
Expand Down
5 changes: 5 additions & 0 deletions packages/menu/src/menu-item.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ governing permissions and limitations under the License.
#selected {
flex-shrink: 0;
}

::slotted(sp-menu) {
/* .spectrum-Menu .spectrum-Menu */
display: block;
}
6 changes: 6 additions & 0 deletions packages/menu/src/spectrum-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ const config = {
/\.spectrum-Menu-checkmark/,
/\.spectrum-Menu-chevron/,
],
complexSelectors: [
{
replacement: '::slotted(sp-menu)',
selector: '.spectrum-Menu .spectrum-Menu',
},
],
},
{
name: 'menu-item',
Expand Down
2 changes: 1 addition & 1 deletion packages/menu/src/spectrum-menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ THIS FILE IS MACHINE GENERATED. DO NOT EDIT */
list-style-type: none;
overflow: auto;
}
:host {
::slotted(sp-menu) {
/* .spectrum-Menu .spectrum-Menu */
display: block;
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/process-spectrum-postcss-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class SpectrumProcessor {
// e.g. `.valid .selector, ::slotted(.invalid) .selector {}` would be lost.
isInvalidSelector = true;
this.warn(
`:slotted() rules must be the last in the selector`,
`:slotted() rules must be the last in the selector: ${selector}`,
{
node: rule,
}
Expand Down

0 comments on commit 8e5ec9b

Please sign in to comment.