Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
324 views
in Technique[技术] by (71.8m points)

css - Bootstrap4:访问变量?(Bootstrap4: Accessing variables?)

I switched from Bootstrap 3 to Bootstrap 4. I am using sass sources which I compile on the run.

(我从Bootstrap 3切换到Bootstrap4。我使用的是运行时编译的sass源。)

When I changed the libraries, I started to get error on my media switches, ie for

(更改库后,我的媒体交换机开始出现错误,例如)

@media screen and (min-width: $screen-md-min) {
    padding: 40px 50px;
}

I get error Undefined variable: "$screen-md-min".

(我收到错误未定义变量:“ $ screen-md-min”。)

What is a correct way to access variables of Bootstrap4?

(什么是访问Bootstrap4变量的正确方法?)

Thank u.

(感谢你。)

  ask by Very Curious translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

See the relevant section of the Bootstrap 4 migration documentation.

(请参阅Bootstrap 4迁移文档的相关部分。)

The @screen-* variables have been replaced by the $grid-breakpoints variable along with the media-breakpoint-up() , media-breakpoint-down() , and media-breakpoint-only() helper Sass mixins.

(@screen-*变量已由$grid-breakpoints变量以及media-breakpoint-up()media-breakpoint-down()media-breakpoint-only()帮助器Sass mixins代替。)

Example usage:

(用法示例:)

@include media-breakpoint-up(md) {
    padding: 40px 50px;
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...