Skip to content

Instantly share code, notes, and snippets.

@elliottregan
elliottregan / input.scss
Created April 19, 2022 16:07
Generated by SassMeister.com.
.input-field {
$color: red;
$size: 25em / 16;
color: $color;
font-size: $size;
// Regular nested class
.input-field--error {
color: red;
}
@elliottregan
elliottregan / input.scss
Created October 21, 2021 19:49
Generated by SassMeister.com.
.input-field {
color: black;
&--error {
color: red;
}
&__label {
color: inherit;
@elliottregan
elliottregan / base.css
Created November 13, 2019 07:07
An example of rem-based spacing using css custom properties
:root {
--const-modular-scale: 1.25;
--const-cap-height: 0.6;
--base-spacing: 0.8rem;
--alpha: calc( var(--const-modular-scale) * var(--const-modular-scale) * var(--const-modular-scale) * var(--const-modular-scale) * var(--const-modular-scale) * var(--const-modular-scale) );
--beta: calc( var(--const-modular-scale) * var(--const-modular-scale) * var(--const-modular-scale) * var(--const-modular-scale) * var(--const-modular-scale) );
--gamma: calc( var(--const-modular-scale) * var(--const-modular-scale) * var(--const-modular-scale) * var(--const-modular-scale) );
--delta: calc( var(--const-modular-scale) * var(--const-modular-scale) * var(--const-modular-scale) );
--epsilon: calc( var(--const-modular-scale) * var(--const-modular-scale) );
@elliottregan
elliottregan / printMeta.js
Created June 5, 2018 20:27
Print out all `<meta>` tags as an array. Use it to collect meta tag information
const allMetaTags = [];
document.querySelectorAll('meta').forEach(el => {
const meta = {};
[...el.attributes].forEach(attr => {
if (attr.name === 'name') {
Object.assign(meta, {
name: attr.value,
});
}
@elliottregan
elliottregan / gist:1591504
Created January 10, 2012 22:13
Course Listings Structure
<ul class="all departments">
<li class="first department">
<ul class="all courses in department">
<li class="first course">
<ul class="all sections on course">
<li class="first section"></li>
</ul>
</li>
</ul>
</li>