springboot怎么把数据传给前端:springboot 如何引入前端 bootstrap?
这种问题网上一搜一大堆,你可以具体找一篇文章试试,遇到问题可以针对相关问题去提问。springboot通过jar包方式引入bootstrap_个人文章 - SegmentFault 思否 这不是查查就
顺晟科技
2022-10-18 13:13:57
35
我有这个SCSS代码:
$box-length: 12 !default;
@for $i from 1 through $box-length {
.box-#{$i} {
flex: 0 0 (100% / $box-length * $i);
}
}
下面,我需要添加生成的.box-{num}
类和其他选择器。要得到这样的CSS结果:
@media screen and (max-width: 768px) {
.row,
.column,
.box,
.box-1,
.box-2,
.box-3,
.box-4,
.box-5 {
/* ... */
}
}
如何将动态.box-{num}
类附加到.row, .column, .box
?
谢谢你们!
顺晟科技:
1。使用占位符选择器和@extend
:@media screen and (max-width: 768px) {
%mq-768 {
/* ... */
}
}
.row,
.column,
.box {
@extend %mq-768;
}
$box-length: 12 !default;
@for $i from 1 through $box-length {
.box-#{$i} {
@extend %mq-768;
flex: 0 0 (100% / $box-length * $i);
}
}
编译为:
@media screen and (max-width: 768px) {
.box-12,
.box-11,
[...],
.box-2,
.box-1,
.row,
.column,
.box {
/* ... */
}
}
.box-1 {
flex: 0 0 8.3333333333%;
}
.box-2 {
flex: 0 0 16.6666666667%;
}
[...]
.box-12 {
flex: 0 0 100%;
}
2。使用变量存储选择器和append
:$selectors: ".row, .column, .box";
$box-length: 12 !default;
@for $i from 1 through $box-length {
$boxSelector: ".box-#{$i}" ;
$selectors: append($selectors, $boxSelector, $separator: comma);
#{$boxSelector} {
flex: 0 0 (100% / $box-length * $i);
}
}
@media screen and (max-width: 768px) {
#{$selectors} {
color: blue;
}
}
编译为:
<代码>.BOX-1{弹性:008.3333333333%;}.BOX-2{弹性:0016.6666666667%;}[...].框-12{弹性:00100%;}@媒体屏幕和(最大宽度:768px){。row,。column,。box,。box-1,。box-2,[...],。box-11,.框-12{/* ... */}}
05
2022-12
02
2022-12
02
2022-12
29
2022-11
29
2022-11
24
2022-11