<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div class="header">I am a header</div>
<div class="text">I am a text</div>
<div class="footer">I am a footer</div>
</body>
</html>
$color: lightcoral;
$color-second: blue;
$font-lg: 2em;
$font-sm: 1em;
@mixin headingStyles {
background-color: $color;
text-align: center;
}
@mixin headingFont($size: 3em) {
color: $color-second;
font-size: $size * 2;
}
@mixin myTransition($params...) {
transition: $params;
}
.header {
@include headingStyles;
@include headingFont($font-lg);
}
.footer {
@include headingStyles;
@include headingFont($font-sm);
}
.text {
@include headingFont();
@include myTransition(color .5s, background-color 1s);
&:hover {
color: $color;
background-color: $color-second;
}
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.