Skip to content
This repository has been archived by the owner on Oct 30, 2020. It is now read-only.

Classnames starting with number cause syntax error #73

Open
m0rtalis opened this issue Oct 9, 2018 · 2 comments
Open

Classnames starting with number cause syntax error #73

m0rtalis opened this issue Oct 9, 2018 · 2 comments

Comments

@m0rtalis
Copy link

m0rtalis commented Oct 9, 2018

Classnames starting with a number [0-9] cause a syntax error in the generated .css.d.ts file.

An example is the classname 35 00px in SemanticUI which results in the type definition export const 35: string;, which obviously throws syntax errors.

A fix is to change the allWordsRegexp to /^[a-zA-Z]\w*$/i. Although no idea if that's the best approach.

@SaphuA
Copy link

SaphuA commented Dec 6, 2018

Interesting.. because css officially doesn't allow digits as the first character of a class name.

@m0rtalis
Copy link
Author

m0rtalis commented Feb 4, 2019

Yes apparently they have efforts to change the class name Semantic-Org/Semantic-UI#5468 but in the meanwhile can the regex be changed to support such class names?
If yes I can create a PR for this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants