threepointone / bs-nice

css-in-reason
180 stars 14 forks source link

write splitSelector in pure reason #9

Open threepointone opened 6 years ago

threepointone commented 6 years ago

currently inlines with [%bs.raw]

https://github.com/threepointone/bs-nice/blob/98611e1aba32a7be3049715900fca2ef64ca256f/src/nice.re#L901

thangngoc89 commented 6 years ago

Could you give me an example input ? I can't figure out what is it doing

threepointone commented 6 years ago

given a string '.a, span:hover, &:matches(h1, h2)', it splits it into an array of selectors, [".a", "span:hover", "&:matches(h1, h2)"]

ulrikstrid commented 6 years ago

Where does selectorTokenizer come from? I can't find it in the source. But I guess it's a regex that looks something like this: /[(),]|"(?:\\.|[^"\n])*"|'(?:\\.|[^'\n])*'|\/\*[\s\S]*?\*\//g?