-
Notifications
You must be signed in to change notification settings - Fork 15
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
Support ability to change color palette in the UI #51
Comments
I think if we want to create a sub-theme for this theme. We need to outsource the sass part of this theme. You incorparate your sass to your theme but another people need to recompile it. Then we need to have this ass a library. We have a sub-theme like that :
If you have this that can works. This is what I tried. This is my sub theme at this time: |
Just change into _color_schema.scss: $primary: 'blue' !default; Then we can override sass variable. |
This is my last version of the sub-theme. |
I understand that you prefer to try to do a feature with css compilation. But I think that if you do this, that's gonna be hard to use git or an other subversion with it. Or we can try to use a specific library like this : http://leafo.net/scssphp/ When we install the theme, that process default version of override file. If we define new color on theme settings we process on more time the sass file. I don't know what do you think about this idea ? => Sry for my english |
Hi, I think the best route right now is to sub-theme - but set up the gulp file to reference all the parent theme scss files and the local sub themes version of the color-schema.scss file. It would be similar to what we did for zurb foundation: https://www.drupal.org/project/zurb_foundation That said, I have looked at the scssphp before - I will look into that option again. One thing I was trying to avoid is forcing a composer install for using the theme - but I think if it was just optional for the colors it could be OK. |
@zolhorvath, I'd be curious if you have any opinion on how we could do this as part of the theme? or maybe as part of material_admin_support? |
Poc ! |
I created a color palette widget for a theme settings that passes in the selected colors as variables so that users can change primary/secondary colors on a site. I did this to avoid using the color module. This might provide a solution here. In my implementation the color palate options were static - but they could easily be made dynamic for the user. In our theme, used by various schools in the Fairfax County School District, the site editors can change the Primary and Secondary colors. These in turn generate a hex code assigned to a variable that is passed to the theme as a twig var {{ color_dark }} or {{color_light }} |
The color palette is easy to update via scss by simply changing the
$primary
,$secondary
, and$accen
t variables in color_schema.scsshowever, this means you would need to sub theme - which is a lot of extra effort for an admin theme. I would like to explore options to change these colors in the UI. The color module is dated and does not support modern CSS architecture like SCSS variables.
Any ideas on how to achieve this are welcome!
The text was updated successfully, but these errors were encountered: