Closed anselmbradford closed 8 years ago
This would also mean:
@green-midtone
➡ @midtone-green
@green-tint
➡ @green-20
Actually on further thought, this kind of makes more sense:
@<color>-<variant>-<tint percentage>
I have always regretted these inconsistencies, but have been too nervous to try updating them and risk breaking everything else.
I suppose you can do stuff like
@dark-gray: @darkgray;
@midtone-green: @green-midtone;
@green-20: @green-tint
While leaving the old ones in place for a time, to give people a chance to update.
That seems like a reasonable migration path. Most projects I see label things deprecated and keep them around for a few releases and then kill them. This projects semver versioning should handle that nicely. There could even be something like a cf-deprecated.less
file that served the opposite purpose of cf-enhancements.less
and was where outmoded variables go to die (eventually).
I was wondering, can we send "deprecated" messages with Less? I know how to do it in Sass, but I'm failing at finding docs for Less.
That would be cool... that settles it, switching to SASS ;)
Ugh, SASS :stuck_out_tongue_closed_eyes:
You could probably build this into a Grunt task though, a precompile step that searches for deprecated Less stuff.
I think I'd rather just switch to Sass...but I guess if we created a deprecated.json
it'd be somewhat easy to utilize in a grunt task and keep up to date.
@jimmynotjim, can you elaborate on how you'd do it in SASS? I'm seeing the @warn
directive but I'm not sure how you'd use it to check for old variable names.
Thinking it through more, I don't think there's a way to check if the variable was used in Sass, only whether it exists, which it would if we left it pointing to the new variable. Your grunt suggestion is probably a better choice in this situation. I'm still curious if Less has something similar for use in mixins and functions.
brand-palette.less
has been updated and has migration instructions in https://github.com/cfpb/generator-cf/blob/master/app/templates/src/static/css/brand-palette.less#L123-L145
brand-palette.less
contains variables@darkgray
and@dark-redorange
. Dark grey should probably be updated to@dark-gray
for consistency. The color naming convention appears to be: