0
私は隣にある要素と同じ色のボックスシャドウを持っていますが、私はCSSトランジションを使ってその両方をフェードインしています。ボックスシャドウと背景色のCSSトランジションは同じなので、なぜ別のレートでフェードインするのかわかりません。CSS:奇妙なボックスのシャドウトランジション
Here a jsfiddle to reproduce the issue、ここでは、関連するSCSSである:
.right-of-blue {
box-shadow: 8px 0 transparent;
}
.outline, .background {
border-color: transparent;
background-color: transparent;
}
// Clicking the button toggles this class on the wrapper div
.colors-enabled {
.should-animate {
transition:
background-color .5s,
box-shadow .5s,
border-color .5s;
}
.outline {
border-width: 1px 2px;
margin: 0 -2px;
background: none !important;
border-style: solid;
}
.background {
border-width: 1px;
margin: 0 -1px;
border-style: solid;
}
.red {
border-color: $red;
background-color: $red;
}
.blue {
border-color: $blue;
background-color: $blue;
}
.right-of-blue {
box-shadow: 8px 0 $blue;
// Bump the outline/background of the next segment over to make room for the box shadow
& + span.outline {
margin-left: 0;
// Bump the text inside back to keep it from moving
& > span > span {
margin-left: -2px;
}
}
}
}
私は二回blue' 'アウトラインがすべき-アニメーションご覧ください。たぶん2番目の要素は、違いがあるように見えるかもしれません。私は 'border-color:black; border-width:2px; '" Hello "と" World "です。別の料金が表示されているかどうかを確認してください。 Alse、 "Hello"と "World"の間にスペースがあることを試してみてください。 –