Skip to content

Instantly share code, notes, and snippets.

@adarsh0d
Created August 31, 2021 10:26
Show Gist options
  • Save adarsh0d/d121112bf226662b635a255ab287b060 to your computer and use it in GitHub Desktop.
Save adarsh0d/d121112bf226662b635a255ab287b060 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
//variables
$font-stack: Helvetica, sans-serif;
$primary-color: #333;
body {
font: 100% $font-stack;
color: $primary-color;
}
//nesting
#content{
font-size: 12px;
&, a{
color: #333;
}
}
.enlarge {
font-size: 14px;
transition: {
property: font-size;
duration: 4s;
delay: 2s;
}
&:hover { font-size: 36px; }
}
//Mixing
@mixin theme($theme: DarkGray) {
background: $theme;
box-shadow: 0 0 1px rgba($theme, .25);
color: #fff;
}
.info {
@include theme;
}
.alert {
@include theme($theme: DarkRed);
}
.success {
@include theme($theme: DarkGreen);
}
//extends
.serious-error{
@extend .alert;
font-weight: bold;
}
//Mathematics
.container {
width: 100%;
}
article[role="main"] {
float: left;
width: 600px / 960px * 100%;
}
aside[role="complementary"] {
float: right;
width: 300px / 960px * 100%;
}
<body>
<div class="info">This is info</div>
<div class="alert">This is alert</div>
<div class="success">This is success</div>
<div class="serious-error">This is success</div>
<div class="container">
<article role="main">
This is main article
</article>
<aside role="complimentary">
This is complimentary
</aside>
</div>
<div id="content">
<div class="enlarge">
Enlarge this
</div>
</div>
</body>
body {
font: 100% Helvetica, sans-serif;
color: #333;
}
#content {
font-size: 12px;
}
#content, #content a {
color: #333;
}
.enlarge {
font-size: 14px;
transition-property: font-size;
transition-duration: 4s;
transition-delay: 2s;
}
.enlarge:hover {
font-size: 36px;
}
.info {
background: DarkGray;
box-shadow: 0 0 1px rgba(169, 169, 169, 0.25);
color: #fff;
}
.alert, .serious-error {
background: DarkRed;
box-shadow: 0 0 1px rgba(139, 0, 0, 0.25);
color: #fff;
}
.success {
background: DarkGreen;
box-shadow: 0 0 1px rgba(0, 100, 0, 0.25);
color: #fff;
}
.serious-error {
font-weight: bold;
}
.container {
width: 100%;
}
article[role=main] {
float: left;
width: 62.5%;
}
aside[role=complementary] {
float: right;
width: 31.25%;
}
{
"sass": {
"compiler": "dart-sass/1.32.12",
"extensions": {},
"syntax": "SCSS",
"outputStyle": "expanded"
},
"autoprefixer": false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment