-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Summary
All CSS at-rules inside <style> elements are removed during the build. Only rules that are plain selectors (or nested selectors with &) plus declarations are kept. The result is broken animations, no media/container/scope/layer/supports behavior, and empty <style></style> blocks in the output.
@keyframesdefinitions are removed (animations break).@media,@container,@scope,@layer, and@supportsblocks are removed (empty<style>tags remain).
What is stripped (broken)
| Source (in .jhp) | Built output |
|---|---|
@keyframes name { ... } |
Removed. Only rules that reference the animation (e.g. animation: name ...) remain, so animation names resolve to nothing. |
@media (...) |
Removed. The corresponding <style> block is emitted empty. |
@container name (...) { ... } |
Removed. Properties that set up the container (e.g. container-type, container-name) are kept; the @container query block is removed. |
@scope (...) to (...) { ... } |
Removed. <style> block is empty. |
@layer name { ... } |
Removed. <style> block is empty. |
@supports (...) { ... } |
Removed. <style> block is empty. |
Any combination of the above (e.g. @keyframes + @media) |
Removed. Block becomes empty. |
So in the built HTML:
- Block 2: Had
@keyframes test-fade,@keyframes test-bounceand.anim-fade/.anim-bounce. Output keeps only.anim-fadeand.anim-bounce; keyframe definitions are gone. - Block 3: Had two
@mediablocks. Output:<style></style>. - Block 4: Had
.test-container-contextand@container demo (min-width: 300px) { .cq-wide { ... } }. Output: only.test-container-context; container query removed. - Blocks 5, 6, 7: Had
@scope,@layer,@supports. Output: three empty<style></style>. - Block 9: Had
@keyframes test-comboand@media (prefers-reduced-motion: no-preference) { .anim-combo { ... } }. Output:<style></style>.
What is preserved
- Plain selector rules (e.g.
.test-legend,.test-section,.anim-fade). - Nested CSS with
&(e.g..test-nested-parentwith& .test-nested-child,& > .test-nested-direct). - Inline
styleattributes on elements. <script type="text/javascript">and<script type="module">content (passed through when script has an attribute; see note below).- HTML structure, SVG,
<pre>/<code>, comments.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working