+ 2
CSS Mixin usage?
Is it not possible to use mixin using the apps compiler? I.e.: @mixin bgcolor { background: red; } Body { /*Not sure which I’m meant to use, seen both of these online but neither work*/ Include: bgcolor; @include bgcolor; } Nothing happens? What am I doing wrong?
14 Antworten
+ 3
Full codes in Code Playground please.
+ 2
Cannot use maxin and include in CSS directly.
Use SASS preprocessor instead.
+ 2
You need tools to convert SASS to CSS. HTML can't work directly with SASS.
+ 1
Just use CSS to style your button.
0
I assume a quick google will suffice to help me there, thanks!
0
How would I go about using mixin if I wanted to on a computer then?
0
I can’t get SASS to work either:
$bgcolor: #FFFFFF;
body {
background-color: $bgcolor;
}
Results in no background change
0
Ah ok, so I'm at an impasse really, I need to invest in a laptop in order to develop my css buttons any further :/
0
I can’t seem to figure out a way to do it. I’m trying to make half of the button text slide down, and a star appear at the top on hover.
0
This is what I have:
nav ul li a div.icon {
position:absolute;
top:-60px;
color:#fff;
padding:0px;
background-color:red;
transition: 1s;
overflow: hiddden;
}
nav ul li a div.icon:hover {
top:0;
overflow: fill;
}
0
Just released them to public. Animated buttons 2 is the one I’m trying at the moment.
Animated buttons uses the @mixin SCSS convention from a working example online. It does what I’m trying to achieve (online in the example), but obviously won’t compile as we have discussed.
0
Animated buttons 2: https://code.sololearn.com/W2iBpL5Tu1b6/?ref=app
0
Animated buttons: https://code.sololearn.com/W0WhqHR4T41s/?ref=app
0
Button 2 is working.