Skip to content

Commit a4bd8ee

Browse files
authored
Improve rendering of classes (#945)
When we have a class like `.inset-1\/4` we want it to look like `inset-1/4`. We used to remove the first character, but that is not correct. Some classes are structured like `*, ::before, ::after {}`. Instead we now drop leading `.` characters instead.
1 parent 6cc5e90 commit a4bd8ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/ClassTable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export const ClassTable = memo(
116116
filterProperties,
117117
preview,
118118
sort = (x) => x,
119-
transformSelector = (x) => (x.length === 1 ? x : x.slice(1).replace(/\\/g, '')),
119+
transformSelector = (x) => x.replace(/^\./g, '').replace(/\\/g, ''),
120120
transformProperties = ({ properties }) => properties,
121121
transformValue,
122122
custom,

0 commit comments

Comments
 (0)