Skip to content

Commit 5720ce3

Browse files
committed
Remove selector dot in class names
1 parent 8fc139c commit 5720ce3

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/bin/css_to_ts/classNames.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const parseClassNames = memoize((rawCssCode: string): string[] => {
1212

1313
rules.forEach(({ selectors }) => {
1414
selectors.forEach(selector => {
15-
const matchArr = selector.match(/^(\.fr-[a-zA-Z0-9_-]+)/);
15+
const matchArr = selector.match(/^\.(fr-[a-zA-Z0-9_-]+)/);
1616

1717
if (matchArr === null) {
1818
return;

test/behavior/bin/classNames/generateBreakpointsTsCode.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ it("Generation of TS code for fr class names", () => {
2929

3030
const expected = `
3131
export const frClassNames= [
32-
".fr-text--light",
33-
".fr-text--xl",
34-
".fr-text--lead",
35-
".fr-grid-row--gutters"
32+
"fr-text--light",
33+
"fr-text--xl",
34+
"fr-text--lead",
35+
"fr-grid-row--gutters"
3636
] as const;
3737
3838
export type FrClassName = typeof frClassNames[number];

test/behavior/bin/classNames/parseClassNames.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ it("Parsing of fr classnames", () => {
2727
2828
`;
2929

30-
const expected = [".fr-text--light", ".fr-text--xl", ".fr-text--lead", ".fr-grid-row--gutters"];
30+
const expected = ["fr-text--light", "fr-text--xl", "fr-text--lead", "fr-grid-row--gutters"];
3131

3232
const got = parseClassNames(input);
3333

0 commit comments

Comments
 (0)