gpt4 book ai didi

sass - 如何在 Bootstrap 中引用 $container-max-widths

转载 作者:行者123 更新时间:2023-12-04 17:07:07 26 4
gpt4 key购买 nike

我目前正在使用 Bootstrap 4,并且对断点进行了一些更改 - 看起来像这样:

$container-max-widths: (
xs: 540px,
sm: 700px,
md: 960px,
lg: 1140px,
xl: 1300px,
g: 1560px,
xg: 1920px
) !default;

这是我的问题:我如何引用 $container-max-widths -> g 得到 1560px 出来吗?

我想做这样的事情,但它不起作用:
max-width: $grid-breakpoints('g');

如果可能的话,有什么想法吗?

最佳答案

您可以创建一个函数来检索断点值,如下所示:

@function get-breakpoints($key: "md") {
@return map-get($container-max-widths, $key);
}

.test-class {
max-width: get-breakpoints("g");
}

关于sass - 如何在 Bootstrap 中引用 $container-max-widths,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47473690/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com