Skip to content

Add shorthand way of getting inline style or getComputedStyle property #134

Closed
@bob2517

Description

@bob2517

Need a handy way of referencing an inline style property. This has come up on a work project but there's a workaround so no major rush.

Possible syntax could be {:property}. Eg.

.myDiv:click {
    $rememberColor: "{:color}";    /* gets existing color and assigns to regular variable as a string */
    color: green;
}
.something:click {
    myDiv {
        color: {$rememberColor};
    }
}

Needs to work on any style. This is not the same solution as using CSS variables, which would work fine too.

This wouldn't be a variable type. Like the attribute {@...} syntax it can't be assigned to anything. It's just a way of getting values.

Metadata

Metadata

Assignees

Labels

docs to doDocumentation still needs doing before this can get releaseddone on branchThis issue has been committed to the latest branch, and will get merged with the next release

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions