Skip to content

✨ [minify-literals] better cssText support #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Gaubee
Copy link

@Gaubee Gaubee commented Apr 21, 2025

getPlaceholder now supports "strict mode" (return string[]), whereas it originally return string ("loose mode").
This better supports CSSminify.
The following CSS-Template-Literals syntax patterns are supported:

1. selector
${selector} {
}

2. key
selector {
  ${key}: value;
}

3. rule
[selector {}]
${rule}
[selector {}]

4. number-literal
selector{
  key: ${param}px;
}

5. value
selector {
  key: ${value};
  key: ${value}
}

6. param
selector{
  key: fun(${param}[, ${param}]);
}

eg:

css`:host{
  ${"width"}: ${10}px;
}`;
css`:host{
  ${"width"}: calc(${10}px + ${"var(--data)"});
}`;

Gaubee added 2 commits April 21, 2025 17:11
getPlaceholder now supports "strict mode" (return `string[]`), whereas it originally returne `string` ("loose mode").
This better supports CSSminify.
The following Template literals syntax patterns are supported:
```
1. selector
${selector} {
}

2. key
selector {
	 ${key}: value;
}

3. rule
[selector {}]
${rule}
[selector {}]

4. number-literal
selector{
  key: ${param}px;
}

5. value
selector {
	 key: ${value};
	 key: ${value}
}

6. param
selector{
  key: fun(${param}[, ${param}]);
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant