🌐 AI搜索 & 代理 主页
Skip to content

Request: support for CSS custom properties #3144

@Getfree

Description

@Getfree

Now that CSS custom properties are supported by most browsers (except for IE), please consider adding support for them in the .css() method.

Example:

<div style="--color: red; color: var(--color)">text</div>
<script>
$('div').css('--color') ; // should return "red"
$('div').css('--color','blue') ; // should change text color to blue

//without jQuery we must currently do it like this:
getComputedStyle($('div')[0]).getPropertyValue('--color') ;
$('div')[0].style.setProperty('--color','blue') ;
</script>

JsFiddle here

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions