Artinov / home-work-7-kramarmm

home-work-7-kramarmm created by GitHub Classroom
0 stars 0 forks source link

Variable naming in SASS #5

Closed eko24ive closed 7 years ago

eko24ive commented 7 years ago

Naming variable like explicitly could bring specific consequences in some time. E.g.

$greyColor: #333333

Yes, color of this variable is gray. You are using this variable three times. But what if you're used this variable fifty times, and I wanted you to change color from #333333 to skyblue. You could simply change $greyColor value, but name of variable isn't referencing to gray color anymore. And you're code became slightly confusing. And you can fix it by changing variable name. Everywhere. Fifty times. Not good, isn't it ?)

It would be better if name of your variable would be more abstract. For example, navigationColor or primaryColor. In this case you can freely and fearless change it's value. And your code remains valid.

kramarmm commented 7 years ago

Fixed

eko24ive commented 7 years ago

Great !