Skip to content

Commit

Permalink
Fix: extract selector should correctly classify selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
metonym committed Mar 18, 2024
1 parent f937182 commit 8772abb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
6 changes: 5 additions & 1 deletion scripts/extract-selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ export function extractSelectors(props: ExtractSelectorsProps) {
if (value.startsWith("bx--") && !value.startsWith(".")) {
classes.push("." + value);
} else {
classes.push(value);
if (value.startsWith(".")) {
classes.push(value);
} else {
classes.push("." + value);
}
}
}
});
Expand Down
22 changes: 11 additions & 11 deletions src/component-index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export const components: Record<string, { path: string; classes: string[]; }> =
"path": "carbon-components-svelte/src/ComposedModal/ComposedModal.svelte",
"classes": [
".bx--modal",
"is-visible",
".is-visible",
".bx--modal--danger",
".bx--modal-container",
".bx--modal-container--xs",
Expand Down Expand Up @@ -586,7 +586,7 @@ export const components: Record<string, { path: string; classes: string[]; }> =
"classes": [
".bx--header__action",
".bx--header__action--active",
"action-text",
".action-text",
".bx--header-panel",
".bx--header-panel--expanded"
]
Expand Down Expand Up @@ -652,11 +652,11 @@ export const components: Record<string, { path: string; classes: string[]; }> =
"HeaderSearch": {
"path": "carbon-components-svelte/src/UIShell/HeaderSearch.svelte",
"classes": [
"active",
".active",
".bx--header__action",
"disabled",
"hidden",
"selected"
".disabled",
".hidden",
".selected"
]
},
"HeaderUtilities": {
Expand Down Expand Up @@ -792,7 +792,7 @@ export const components: Record<string, { path: string; classes: string[]; }> =
"classes": [
".bx--modal",
".bx--modal-tall",
"is-visible",
".is-visible",
".bx--modal--danger",
".bx--modal-container",
".bx--modal-container--xs",
Expand Down Expand Up @@ -914,9 +914,9 @@ export const components: Record<string, { path: string; classes: string[]; }> =
".bx--number__invalid--warning",
".bx--number__controls",
".bx--number__control-btn",
"down-icon",
".down-icon",
".bx--number__rule-divider",
"up-icon",
".up-icon",
".bx--form__helper-text",
".bx--form__helper-text--disabled",
".bx--form-requirement"
Expand Down Expand Up @@ -1865,9 +1865,9 @@ export const components: Record<string, { path: string; classes: string[]; }> =
".bx--tree",
".bx--tree--default",
".bx--tree--compact",
"li.bx--tree-node:not(.bx--tree-node--disabled)",
".li.bx--tree-node:not(.bx--tree-node--disabled)",
".bx--tree-node--disabled",
"li.bx--tree-node"
".li.bx--tree-node"
]
},
"truncate": {
Expand Down

0 comments on commit 8772abb

Please sign in to comment.