1
1
100R2019-08-30 15:01:28
Sass
100R, 2019-08-30 15:01:28

Alternative to map-remove in scss?

Is there a way not to specify what needs to be removed, but on the contrary - to indicate what needs to be left? That is, if I need to leave 1 color, then why should I specify 7 colors to be removed, when I could specify 1 to be left.
Plus, I found the comment "Only use the utilities we need" in the source code. But in fact, I did not manage to remove unused utilities through map-remove. Can I have a small example?

@import "~bootstrap/scss/functions";
@import "~bootstrap/scss/variables";
@import "~bootstrap/scss/mixins";
@import "~bootstrap/scss/utilities";

$colors: map-remove($colors, 
    "blue",
    "indigo",
    "purple",
    "pink",
    "red",
    "orange",
    "yellow",
    "green",
    "teal",
    "cyan",
    "white",
    "gray",
    "gray-dark"
);

$theme-colors: map-remove($theme-colors,
    "primary",
    "secondary",
    "success",
    "info",
    "warning",
    "danger",
    "light"
);

@import "~bootstrap/scss/root";
@import "~bootstrap/scss/reboot";
@import "~bootstrap/scss/grid";
@import "~bootstrap/scss/buttons";

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question