How can we make colors configurable

I want to use the site.yaml to set the colors used in the theme’s _colors.scss. Additionally I want to override certain colors from within my .md files.
But how can this be achieved?

Well, because SCSS is compiled offline, you can’t really do it directly with the regular _colors.scss.

There are a few options though:

  1. Simplest is to set some colors in an inline <style></style> tag in the page header.

  2. You could write out a custom css/colors.css file from a plugin or from an event in the theme (if changed or doesn’t exist).

  3. You could employee a PHP SCSS compiler ( via a plugin to dynamically compile out a colors.css file.

There IS a SCSS compiler?! Didn’t know that. Is the ruby based compiler exchangable for this one?

In the antimatter config file you recently removed a color option. Did you plan to make it configurable throughout the theme? How would you have done it?

There is a PHP one and its compatible with SASS v3.2 I believe.

The Antimatter variable was for testing only and was never integrated. If it were it probably would of been via option 1 for simplicity. Gantry5 which is a theme framework RocketTheme uses for cross platform theme development will have the PHP SCSS compiler method.

I tried to use the php scss compiler with grav but it doesn’t handle any includes, which means there’s nothing compiled at all. :expressionless: I hoped I could make the scss part independed from ruby… Wouldn’t this be a good addition for the admin plugin - I mean being able to compile just from within the panel completely without ruby…?

I would use the PHP compiler on your own specialized colors.scss file. That way you won’t have to compile the whole theme css file everytime. Just make sure to use more specificity in your custom CSS to override the default.

I will have to look into the possiblity of compiling the whole thing from the admin panel. The PHP SCSS compiler is a little behind the Ruby compiler feature-wise, so I would have to ensure we’re not doing anything it can’t handle.

As far i can read, there is no SCSS compiler in Grav (like gantry 5) ?
if yes, it is on tube for next version ?
if yes and no
Do you have a tuto for newby how to install u php scss compiler and use the famous command
scss --watch scss:css-compiled
or i have to forgot _custom.scss for grav and focus with custom .css


There is no scss compiler in Grav… Installing SASS (sass/scss included) depends on your platform. I’m on a mac, and use brew so for me it was just:

$ brew install sass

But there are many other ways. Best to read the installation docs on the Sass site:

Ok thanks
i’m working with windows vista !!
So, i have installed Ruby, then SASS (with Ruby prompt)

means, anytime i want to compile i have to work locally ?

i create a folder dedicated for compilation in my computer (compil)
i transfert all scss folder and css-compiled folder of antimatter into this folder via ftp

i modify the file _custom.scss locally (scss/template) following what i need

with ruby prompt i move to this folder
then i run the famous line : scss --watch scss:css-compiled
new compiled files is created in css-compiled folder

logically, i just have to transfert new template.css file (created in css-compiled) and replace old one into the website css-compiled folder ? or all files ?

it is the right way to work ?

I would always recommend developing locally. Only put on your live site when you are happy. This is a much more efficient way of developing as I outlined in this blog post. I would recommend no other way frankly!

Ok, you baited me, why oh why are you running Windows Vista!!! ??? I understand your stuck with a PC, but surely you can run a newer version?

My old computer cannot support other version !! now just a question of money !!
and running a local web server with vista is not a good deal
was great with server2Go some years ago but it is not updated => no support new php version. last test install was suck. maybe i will try BitNami

Bitnami is great for local server (php 5.5.26)

I’m running Grav easily on my raspberry pi so I’m sure you could run a nice version of linux on your computer no matter how old :slight_smile: I strongly suggest that over vista.