Skip to content

Allow for empty CSS variable definitions #1849

@rodrigogiraoserrao

Description

@rodrigogiraoserrao

Consider the following CSS snippets:

$x: 
* {
    background: red;
}
$x:
* {
    background: $x;
}
* {
    background: red;
}
$x:

All three should work with the following behaviour:

  • an empty variable definition is allowed; and
  • setting a style to an empty variable should unset that style.

For example, 2. should unset the background of all widgets.

As of now, 2. and 3. can't be parsed.
2. raises an error regarding an undefined variable and 3. raises an AttributeError inside substitute_references in parse.py.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions