Retrieve Gin css variables in another custom theme

Created on 4 April 2023, over 1 year ago
Updated 5 April 2023, over 1 year ago

Hi everyone,

I'm looking for a way to get the custom accents variables defined in /admin/appearance/settings/gin in my custom theme, but i'm not able to do it.

This is what I want to do:

  • Define Gin as admin theme
  • In Gin Settings, define some custom accent color
  • In themes/custom/my_custom_theme, I'll use for example
    color: var(--gin-color-primary)

Is this a way to do this?

Thans you!

💬 Support request
Status

Closed: works as designed

Component

Documentation

Created by

🇪🇸Spain tdorleac

Live updates comments and jobs are added and updated live.
  • CSS

    It involves the content or handling of Cascading Style Sheets.

Sign in to follow issues

Comments & Activities

  • Issue created by @tdorleac
  • Status changed to Closed: works as designed over 1 year ago
  • 🇨🇭Switzerland saschaeggi Zurich

    Note that this is nothing we officially support.

    You potentially can use

    \Drupal::classResolver(GinSettings::class);
    $settings->get('preset_accent_color');

    to receive the accent color setting as a value in PHP. You might want to have a look at the gin_toolbar source code to have a look how we check for the accent color.

    To receive the CSS3 vars you might want to look at the source code of gin_login gin_login_page_attachments_alter() function. You might only need the accent bits.

    That's all I can help you with.

    Cheers!

Production build 0.71.5 2024