clay
clay copied to clipboard
@clayui/css: Custom Control group deprecated variables together
We have a lot of deprecated variables that we keep around for backward support. It's pretty hard to keep track of variables that are current under Clay. We should try and group them together as much as possible, ideally at the top of the file, but we have some variables that inherit un-deprecated variables which makes it hard. Here are some examples or deprecated variables:
https://github.com/liferay/clay/blob/70003b9a68d65f5d1749487dac57e90cbd2b057f/packages/clay-css/src/scss/variables/_custom-forms.scss#L62-L80
Yeah, this would be nice to have this cleaner. Would it be possible to have all the deprecated variables and even the compatibility-layer use of those deprecated variables in a separate _deprecated_variables.scss
file? Something like:
_deprecated_variables.scss
contains:
/// @deprecated as of v2.2.1 use `$custom-control-indicator-checked-active-border-color` instead
$custom-control-indicator-active-checked-border-color: null !default;
$custom-control-indicator-checked-active-border-color: $custom-control-indicator-active-checked-border-color !default;
Then _custom-forms.scss
could just contain the current variables:
$custom-control-indicator-checked-active-border-color: null !default;
It would be slightly more code, but would make it simpler to see the current variables that should be used. What do you think? Would there be a way to have this in separate files?
I like Evan's idea even to have visibility of the amount of things we keep for compatibility, I also think that we should already start planning Clay v4 to remove these compatibilities and clean up the CSS and also the components that we have many conditions for backwards compatibility.
LPS ticket: https://liferay.atlassian.net/browse/LPS-190186