Skip to content

Commit

Permalink
twbs#23690: Add quotes to mapping keys
Browse files Browse the repository at this point in the history
  • Loading branch information
MartijnCuppens committed Aug 28, 2017
1 parent 9cdf43d commit 4f82186
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ $black: #000 !default;

$grays: () !default;
$grays: map-merge((
100: $gray-100,
200: $gray-200,
300: $gray-300,
400: $gray-400,
500: $gray-500,
600: $gray-600,
700: $gray-700,
800: $gray-800,
900: $gray-900
"100": $gray-100,
"200": $gray-200,
"300": $gray-300,
"400": $gray-400,
"500": $gray-500,
"600": $gray-600,
"700": $gray-700,
"800": $gray-800,
"900": $gray-900
), $grays);

$blue: #007bff !default;
Expand Down Expand Up @@ -63,14 +63,14 @@ $colors: map-merge((

$theme-colors: () !default;
$theme-colors: map-merge((
primary: $blue,
secondary: $gray-600,
success: $green,
info: $cyan,
warning: $yellow,
danger: $red,
light: $gray-100,
dark: $gray-800
"primary": $blue,
"secondary": $gray-600,
"success": $green,
"info": $cyan,
"warning": $yellow,
"danger": $red,
"light": $gray-100,
"dark": $gray-800
), $theme-colors);

// Set a specific jump point for requesting color jumps
Expand Down

3 comments on commit 4f82186

@tommyc38
Copy link

Choose a reason for hiding this comment

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

@MartijnCuppens, can you please explain why you create an empty map and merge it? Is this for custom colors? I am just trying to understand the motivation here. Thanks!

@MartijnCuppens
Copy link
Owner Author

Choose a reason for hiding this comment

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

Hi @tommyc38, I just implemented a fix for twbs#23690, the empty array was there before.

However, I think this is done so you can define your own colors configuration like:

$theme-colors: (
  "highlighted" : '#ffff00',
  "shadow-color" : '#222222'
);

Afterwards, you can include Bootstrap and you can use color("highlighted") in your custom scss.

If you didn't define $theme-colors before including Bootstrap, SCSS would throw an error if the empty array wasn't defined.

Is that clear to you?

@tommyc38
Copy link

Choose a reason for hiding this comment

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

@MartijnCuppens, thanks for clarifying that for me. I thought it was for custom colors but wasn't quite sure given both maps have the same name. I think would be more explicit calling it "custom-color" or "custom-theme-color". Thanks again!

Please sign in to comment.