我有这个修改的codepen http://codepen.io/anon/pen/jPPgoY(原始版本是由卢卡斯Bebber制作的),我试图让它在wordpress中使用自定义css
字段,但我认为缺少某些东西不起作用。CSS破文本情况
1)我是否需要使用css3
插件来导入外部文件或其他东西?第一个css
行让我想到这一点。
2)如果上面提到的点太多了,有没有可能修改代码以便在没有动画的情况下使用css
wordpress中的自定义字段?
HTML
<div data-text="a" class="dashed-shadow">a</div>
<div class="dashed-shadow">a</div>
CSS
@import "compass/css3";
//Variables here:
//(alongside with commented suggestions)
$foreground-color:orange;//black;
$background-color:white;//white
$shadow-color:gray;//$foreground-color;
$distance:18px;
$cut-distance:3px;//$distance/4;
$strips-size:6px; //10px nice values 4px,3px
$strips-ratio:50%;//70%
$strips-angle:45deg;//90deg;
//cray stuff yo. be sure to try (if you please)
$animate:false;//true
$fixed:false;//true
body{
font-family: 'arial black';
font-size:895pt;
background-color:$background-color;
text-align:center;
line-height:1em;
padding-top:5px;
}
.dashed-shadow{
position:relative;
top:$distance;
left:$distance;
display:inline-block;
color:$shadow-color;
}
@keyframes dash-animation{
0% {background-position:0 0};
100% {background-position:100% 0};
}
.dashed-shadow:before{
content:" ";
display:block;
position:absolute;
$bleeding-horizontal:0px;
$bleeding-vertical:0px;
top:350px;
left:-$bleeding-vertical - $distance;
bottom:-$bleeding-horizontal + $distance;
right:-$bleeding-horizontal + $distance;
z-index:1;
$color:$background-color;
$size:$strips-ratio/2;
$halfSize:$size/2;
$p1:$halfSize;
$p2:50%-$halfSize;
$p3:50%+$halfSize;
$p4:100%-$halfSize;
$transparent:transparentize($color,1);
@include background-image(linear-gradient($strips-angle,$color $p1, $transparent $p1, $transparent $p2,$color $p2, $color $p3, $transparent $p3, $transparent $p4, $color $p4));
background-size:$strips-size $strips-size;
@if($animate){
animation:dash-animation 30s infinite linear;
}
@if($fixed){
background-attachment:fixed;
}
}
.dashed-shadow:hover:before{
animation:dash-animation 10s infinite linear;
}
.dashed-shadow:after{
z-index:2;
content:attr(data-text);
position:absolute;
left:-$distance;
top:-$distance;
color:$foreground-color;
text-shadow:$cut-distance $cut-distance $background-color;
}
CSS @import指令引入一个外部的css文件,所以你当然需要提供该文件,以便css按预期工作... – DrCord
感谢您的反馈,作为一个起点很好知道,那个文件应该是? LE:我发现[this](http://compass-style.org/reference/compass/css3/)可以成为我将继续搜索的答案的一部分。 –
不知道你发布的内容:'compass/css3' – DrCord