Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(@clayui/css): Mixins clay-select-variant update to use `clay-cs… #4047

Merged
merged 2 commits into from
May 18, 2021

Conversation

pat270
Copy link
Member

@pat270 pat270 commented May 5, 2021

…s` pattern, also deprecated keys should win over new keys

fix(@clayui/css): Update Sass maps that use clay-select-variant to use new keys: $date-picker-nav-select and $input-select

fixes #4046

@pat270 pat270 marked this pull request as draft May 6, 2021 02:41
pat270 added 2 commits May 12, 2021 14:14
…s` pattern, also deprecated keys should win over new keys

fix(@clayui/css): Update Sass maps that use `clay-select-variant` to use new keys: `$date-picker-nav-select` and `$input-select`
@pat270 pat270 marked this pull request as ready for review May 12, 2021 21:25
Copy link
Member

@matuzalemsteles matuzalemsteles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @pat270 I'm taking a look at this to understand more about how everything is working around Clay CSS, so I'm going to ask more questions from now on, probably always doubts.

Comment on lines 53 to -54
$date-picker-nav-select: () !default;
$date-picker-nav-select: map-deep-merge((), $date-picker-nav-select);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question about the unrelated this change:

  • Double declaration in sequence: the last declaration rewrite the last declaration, right? why double declaration?
  • Once you removed the last declaration, what's the expected side effect? if it exist, of course.

Copy link
Member Author

@pat270 pat270 May 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matuzalemsteles Not a problem, map-merge takes whatever was declared in the first map and combines the two. If there are two keys with the same name in both maps, whatever is declared in the second map wins between the two. This is a way (hack?) to provide default values with Sass maps.

An example that may help explain better:

// This one replaces `$map: () !default;` below it
$map: (
  background-color: #eee,
  color: red,
) !default;

$map: () !default;
$map: map-merge((
  color: black,
  font-size: 16px,
), $map);

// $map will be:
$map: (
  background-color: #eee,
  color: red,
  font-size: 16px,
);

If we don't use map-merge while providing default values:

$map: (
  background-color: #eee,
  color: red,
) !default;

$map: (
  color: black,
  font-size: 16px,
) !default;

// $map will be:
$map: (
  background-color: #eee,
  color: red,
);

The reason we don't need it here is because we aren't providing any default values for $date-picker-nav-select.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm makes sense, thanks for the clarification.

Copy link
Member

@matuzalemsteles matuzalemsteles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@marcoscv-work
Copy link
Member

LGTM and merge!

@marcoscv-work
Copy link
Member

I'm not sure why it was for 13 days here...

@marcoscv-work marcoscv-work merged commit fcc9e36 into liferay:master May 18, 2021
@pat270 pat270 deleted the clay-4046 branch March 15, 2023 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants