Skip to content

Conversation

@oliverfoster
Copy link
Member

@oliverfoster oliverfoster commented Jun 18, 2024

fixes #3577

New

  • Allow theme variables to be modified from the config.json bringing them into compile and runtime space

Testing

Set config.json:themeVariables._buttons.btn-color = "red".

Menu button

image

build/adapt.css

image

config.json

"themeVariables": {
    "_global": {
      "font-color": "",
      "font-color-inverted": "",
    },
    "_items": {
      "item-color": "",

Only the final "name": "value" pair of each nested section will be used as the Less and CSS property names and values:

image

Null string "" or null values will not be declared.

CSS variables are prefixed by adapt-, like --adapt-font-color. CSS variables are assigned to the :root { ... } context.

Less variables are not prefixed, like @font-color.

Variables are declared at the end of the output Less, this is in order to give them precedence.

AAT v1 theme schema

It appears that there is a detached schema defining theme variables outside of grunt compilation
https://github.com/adaptlearning/adapt-contrib-vanilla/blob/master/schema/theme.schema.json

Todo

Copy link
Contributor

@guywillis guywillis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

@oliverfoster
Copy link
Member Author

Setting to draft as with @taylortom for approval

@oliverfoster oliverfoster marked this pull request as draft January 6, 2025 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Awaiting Response

Development

Successfully merging this pull request may close these issues.

Integrate theme settings into compilation

7 participants