Skip to content

Cascading vars: Plugin works correctly? Or browsers do not work correctly? #78

@belozer

Description

@belozer

I'am not found specs with examples abount cascading vars. But try this case https://github.com/MadLittleMods/postcss-css-variables#caveats native in Browser on CodePen. (without plugin)

<div class="component">
    Black

    <h1 class="title">
        Blue

        <p class="decoration">
            Green

            <h1 class="title">Blue with this plugin, but green per spec</h1>
        </p>
    </h1>
</div>
.component {
  --text-color: blue;
}

.component .title {
  color: var(--text-color);
}

.component .decoration {
  --text-color: green;
  color: var(--text-color);
}

image

It turns out that the plugin works correctly? Or browsers do not work correctly?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions