D
D
DmitryRise2018-09-19 19:35:28
Project management
DmitryRise, 2018-09-19 19:35:28

How to keep track of color variables (colors) in a large project?

Hello, I'm currently working on a large project that has a separate list of variables for colors. At the moment it looks like this
$color_black
$color_dark_black
$color_black2
$color_very_dark_black
In general, a complete mess. Please tell me how to keep the names of variable colors in order (we refer to them often).

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
GavriKos, 2018-09-19
@GavriKos

Name them functionally, not by content.
color_header
color_body
etc.

E
Evgeny Ivanov, 2018-09-24
@logpol32

As if taken from my project. Not sass by any chance?
A lot of advice has been given above. I do not claim to be an expert, but in my opinion it is correct to give a color a meaningful name.
Those. you are doing everything right.
But then, as GavriKos said, do it this way, but with slight changes in the
pseudocode (too lazy to remember the syntax)

//Цвета
$color_black:#000000;
//Цвет хэдэра
$color_header=$color_black;

Separate colors in your project. They can be constants as well (in the sense they are, because $color_black won't be #ffffff )
Separate project elements.
Give the element your color, your style, whatever.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question