Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New: Added theme variables to compilation (fixes #3577) #3578

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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.

👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs Reviewing
Development

Successfully merging this pull request may close these issues.

Integrate theme settings into compilation
4 participants