Skip to content

Implement CSS3 basic arithemetic functions #691

@hyblocker

Description

@hyblocker

Implementing CSS3 arithmetic functions would improve one's ability to do dynamic complex layouts using RmlUI (eg dynamically scaling elements based on viewport dimensions). For instance, one could use CSS such as the following:

div#my-cool-div {
    width: calc(100% - 32px); /* We need a constant width of 32px from the right */
}

We would have to start with defining a parser to parse the arithmetic grammar properly and likely also implement an expression cache (to avoid evaluating them every frame) whenever possible.

The definition of these arithmetic functions is defined here.

Is such a feature beyond the scope of this project or not, given it does not aim to implement the entirety of CSS3?

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionMeta talk and feedbackenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions