问题描述
我需要第二双眼睛。 LESS 不断给我一个解析错误,但我找不到它。我已将代码分成几部分,并逐行删除/添加内容,但没有运气。我从另一个 teamj 继承了这个代码。
我怀疑他们使用的是旧版本的 LESS,但他们没有给我任何文档。
感谢所有帮助!
.panel-cards {
overflow-y: visible;
overflow-x: hidden;
.deck {
display: flex;
overflow: visible;
overflow-x: scroll;
//-webkit-overflow-scrolling: touch; //conflict with modal popups (and unnecessary?)
&:after {
content: '';
width: 1px;
height: 100px;
display: block;
flex-shrink: 0;
}
}
article {
flex-shrink: 0;
display: flex;
flex-direction: column;
width: unit(294/4.14,vw);
margin: 0 unit(15/4.14,vw) unit(30/4.14,vw) unit(15/4.14,vw);
.image {
background-position: center center;
background-size: cover;
background-repeat: no-repeat;
.Box-sizing(border-Box);
padding-top: 71%;
overflow: hidden;
max-width: 100%;
&.contain {
background-size: contain;
}
}
.copy {
.Box-sizing(border-Box);
.copy {
span {
width: 100%;
float: left;
p{
margin: 0px 0px 8px 0px;
line-height: 120%;
font-family: 'Roboto',Helvetica,Arial,sans-serif;
font-weight: 600;
text-align: left;
vertical-align: baseline;
}
}
h3 + p {
margin-top: 0;
}
p {
margin: unit(18/4.14,vw) 0;
font-weight: @medium;
line-height: 117%;
}
a:not(.btn) {
color: @green;
font-weight: @bold;
&:hover {
color: @green;
}
}
}
}
} //end panel-cards
解决方法
更正这些:font-weight: @medium;
color: @green;
font-weight: @bold;
color: @green;
以及“}”在打开和关闭之间不匹配。
这是您要找的吗?
.panel-cards {
overflow-y: visible;
overflow-x: hidden;
}
.panel-cards .deck {
display: flex;
overflow: visible;
overflow-x: scroll;
}
.panel-cards .deck:after {
content: '';
width: 1px;
height: 100px;
display: block;
flex-shrink: 0;
}
.panel-cards article {
flex-shrink: 0;
display: flex;
flex-direction: column;
width: 71.01449275vw;
margin: 0 3.62318841vw 7.24637681vw 3.62318841vw;
}
.panel-cards article .image {
background-position: center center;
background-size: cover;
background-repeat: no-repeat;
box-sizing: border-box;
padding-top: 71%;
overflow: hidden;
max-width: 100%;
}
.panel-cards article .image.contain {
background-size: contain;
}
.panel-cards article .copy {
box-sizing: border-box;
}
.panel-cards article .copy .copy span {
width: 100%;
float: left;
}
.panel-cards article .copy .copy span p {
margin: 0px 0px 8px 0px;
line-height: 120%;
font-family: 'Roboto',Helvetica,Arial,sans-serif;
font-weight: 600;
text-align: left;
vertical-align: baseline;
}
.panel-cards article .copy .copy h3 + p {
margin-top: 0;
}
.panel-cards article .copy .copy p {
margin: 4.34782609vw 0;
font-weight: medium;
line-height: 117%;
}
.panel-cards article .copy .copy a:not(.btn) {
color: green;
font-weight: bold;
}
.panel-cards article .copy .copy a:not(.btn):hover {
color: green;
}