// Compile sass into CSS & auto-inject into browsers
gulp.task('sass', function() {
return gulp.src("app/scss/*.scss")
.pipe(sass())
.pipe(gulp.dest("app/css"))
.pipe(browserSync.stream());
});
gulp.task('critical', ['build'], function(cb) {
critical.generate({
inline: true,
minify: true,
width: 320,
height: 480
});
});
gulp.task('lint:css', function () {
return gulp.src('src/**/*.css')
.pipe(postcss([
stylelint({/* your options */}),
reporter({clearMessages: true}),
]))
});
.svg-icon {
height: 100px;
overflow: visible;
width: 100px;
}
.svg-icon path {
animation: animatePath 5s 1s forwards infinite;
fill: none;
stroke: rgba(255, 255, 255, .9);
stroke-width: 0.45;
}
.normal { /* ... */ }
.disabled { /* ... */ }
.error { /* ... */ }
import styles from './submit-button.css';
buttonElem.outerHTML= `
<button class=${styles.normal}>Submit</button>
`;
<button class="components_button__normal__abc5436">
Submit
</button>
.common { /* font-size, border-radius */ }
.normal { composes: common; /* blue color */ }
.error { composes: common; /* red color */ }
<button class="components_button__common__abc5436
components_button__normal__def6547">
Submit
</button>
import styles from './submit-button.css';
buttonElem.outerHTML= `
<button class=${styles.normal}>Submit</button>
`;
.primary {
color: #720;
}
.secondary {
color: #777;
}
.common { /* ... */ }
.normal {
composes: common;
composes: primary from "../shared/colors.css";
}
.flex-title {
display: flex;
align-items: flex-end;
flex-wrap: wrap;
.title-main {
flex-grow: 1;
}
}
.main {
column-count: 3;
column-gap: 30px;
column-rule: 1px dotted #999999;
}
.sidebar { grid-area: sidebar; }
.content { grid-area: content; }
.wrapper {
display: grid;
grid-gap: 1em;
grid-template-areas: "sidebar"
"content"
}
div {
display: flex;
}
div {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex
}
:root {
--fontSize: 1rem;
}
body {
font-size: var(--fontSize);
}
body {
font-size: 16px;
font-size: 1rem;
}
@custom-media --viewport-medium (
width <= 50rem
);
@media (--viewport-medium) {
body {
font-size: 1.2em;
}
}
@media (max-width: 50rem) {
body {
font-size: 1.2em;
}
}
@custom-selector :--heading h1, h2, h3
:--heading { margin-top: 0 }
h1,
h2,
h3 { margin-top: 0 }
body {
background-color: color(#ffffff blackness(+5%));
}
body {
background-color: rgb(243, 243, 243);
}
body {
background: #9d9c;
/* Same as #99dd99cc */
}
body {
background: rgba(153, 221, 153, 0.8);
}