Skip to content

Extend spacers and sizes#25101

Merged
mdo merged 3 commits intotwbs:v4-devfrom
unrevised6419:extend-spacers-sizes
Jan 16, 2018
Merged

Extend spacers and sizes#25101
mdo merged 3 commits intotwbs:v4-devfrom
unrevised6419:extend-spacers-sizes

Conversation

@unrevised6419
Copy link
Copy Markdown

@unrevised6419 unrevised6419 commented Dec 28, 2017

Extend $spacers and $sizes like $theme-colors and other maps.

Used // stylelint-disable because stylelint complains about map on single line.

ps: Can $grid-breakpoints and $container-max-widths also be extended like this?

@mdo
Copy link
Copy Markdown
Member

mdo commented Dec 30, 2017

I suppose all our Sass maps should behave the same way—it'd make documentation easier. The only problem is removing values from the maps this way—you have to use map-remove. Not the end of the world, but worth noting here.

Comment thread scss/_variables.scss
// variables. Mostly focused on spacing.
// You can add more entries to the $spacers map, should you need more variation.

// stylelint-disable
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can't we be more explicit with what we disable here?

Copy link
Copy Markdown
Author

@unrevised6419 unrevised6419 Jan 15, 2018

Choose a reason for hiding this comment

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

As in case for other empty maps. Stylelint does not allow empty maps ex:

// stylelint-disable
$grays: () !default;
// ...
$colors: () !default;
// ...
$theme-colors: () !default;
// ...
// stylelint-enable

https://github.com/twbs/bootstrap/blob/v4-dev/scss/_variables.scss#L11

Should I add a comment line in code why I disable it?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No worries, I remembered I had to do the same there when we switched to stylelint.

@mdo mdo mentioned this pull request Jan 16, 2018
@mdo mdo merged commit 814e5b7 into twbs:v4-dev Jan 16, 2018
@karengrigoryan
Copy link
Copy Markdown

To add/modify values in $grid-breakpoints and $container-max-widths we still need to copy the whole map to custom.scss in 4.0.0. Any chance to extend them like other maps?

@unrevised6419
Copy link
Copy Markdown
Author

unrevised6419 commented Jan 19, 2018

UPDATE: You can't do this. $grid-breakpoints and $container-max-widths should be sorted
For now you can map-merge after default vars import.

@unrevised6419 unrevised6419 deleted the extend-spacers-sizes branch January 19, 2018 07:40
@unrevised6419
Copy link
Copy Markdown
Author

@karengrigoryan #25392

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants