Svelte: CSS attribute substring selector not working with scoped styles

Created on 15 Feb 2017  路  2Comments  路  Source: sveltejs/svelte

Example: https://svelte.technology/repl/?version=1.6.8&gist=6587ab0c1af69e07411f99b3bd8a6979

The svelte identifier attribute is getting injected into the attribute selector for some reason:

.someStyle[svelte-391727275], [svelte-391727275] .someStyle {
  color:red;
}
[class*="  another"][svelte-391727275], [class*="  [svelte-391727275] another"], [class*="[svelte-391727275]  another"], [svelte-391727275] [class*="  another"] {
  background:black;
}
bug

All 2 comments

Confession time: the CSS parsing in Svelte is a giant hack 鈥斅爄t's all regex-based. I would guess it's getting tripped up by the space character in " another". What we really need to do is use PostCSS to transform the CSS instead.

This is fixed in 1.6.9 鈥斅爐hanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bestguy picture bestguy  路  3Comments

noypiscripter picture noypiscripter  路  3Comments

AntoninBeaufort picture AntoninBeaufort  路  3Comments

rob-balfre picture rob-balfre  路  3Comments

angelozehr picture angelozehr  路  3Comments