Skip to content

Proposal: refactor css placeholder for TemplateLiteral #6790

@fisker

Description

@fisker

CSS in template literals is first added in #2102 @prettier-placeholder is choosed to be a placeholder for template quasis.

Now problem is TemplateLiteral could be anywhere of the css code

as tag

${as-tag}{}
@prettier-placeholder{}

tag selector became a at-rule, but we handled in at-rule

as part of tag

foo${as-part-of-tag}{}
foo@prettier-placeholder{}

foo[${as-part-of-selector}]{}
foo[@prettier-placeholder]{}

foo@prettier-placeholder is not a legal tag,postcss-selector-parser can parse currectly, but might cause problem in future,

bug1 bug2

as value

div{
  font: bar${as-part-of-selector}
}
div{
  font: bar@prettier-placeholder
}

bar@prettier-placeholder will be to values, a word and a at-word,

bug

will comment more details

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions