Skip to content

[CSS-localStorage-rule] CSS needs rule references to localStorage values, to be responsive to user input. #4933

@Dorson

Description

@Dorson

[css-localStorage-rule]

CSS needs to be able to set style rules in reference to the values that were saved in the localStorage of the browser. Like for color settings, or text size settings, or position settings.

Here is an example to understand why.

CSS rule example for the user-set color preferences.
Similar as we do in the attribute selector rules :

html[localStorage( ColorTheme == dark )] { background: black ; }
..or...
html[localStorage( ColorTheme == green )] { background: green ; }

OR as we do in the media rules :

@localStorage( ColorTheme == dark ) {
      body { background: black ;  }
}

Such rules would be able to set the black background for the html tag, if the localStorage cell list of ColorTheme had the "dark" entry value in the list.

The read-only access to the localStorage of the browser would make the CSS truly dynamic and responsive to the user input. Users apps would be able allow to set and remember the personal style settings. Positions of the movable page elements would be possible to be remembered, if the user wanted to do so.

The write access changes should be still left to the JavaScript side.

Good Day fellow travelers !

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions