Skip to content

Support theming with CSS Custom Properties #4352

Closed
@SanderElias

Description

@SanderElias

feature request

Use CSS custom properties for at least color selection.

What is the expected behaviour?

To be able to alter the color-scheme during runtime on supported browsers, and fall-back to predefined SASS defined colors on others

Here is a sample (by Cris Coyier) of how CSS custom properties might work

Is there anything else we should know?

Here is a simple sass mixin that might help:

@mixin variable($property, $variable, $fallback) {
  #{$property}: $fallback;
  #{$property}: var($variable);
}

By using something like that mixin, support for browsers that have no CSS variables support, stay's the same way as its now, while supported browsers gain a way more flexible way to use colors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4A relatively minor issue that is not relevant to core functionsarea: themingblockedThis issue is blocked by some external factor, such as a prerequisite PRfeatureThis issue represents a new feature or feature request rather than a bug or bug fixneeds: discussionFurther discussion with the team is needed before proceeding

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions