Skip to content

Instantly share code, notes, and snippets.

View davidhellmann's full-sized avatar
🤔
Focusing

David Hellmann davidhellmann

🤔
Focusing
View GitHub Profile
@davidhellmann
davidhellmann / input.scss
Created May 17, 2021 13:36
Generated by SassMeister.com.
/*
// build the clamp property
const clamp = (multiMin = 0, multiMax = null) => {
const _calcMulti = calcMulti(multiMin, multiMax || multiMin)
const _fsMin = _calcMulti.fsMin
const _fsMax = _calcMulti.fsMax
return `clamp(${_fsMin}rem, calc(${_fsMin}rem + (${_fsMax} - ${_fsMin}) * ((100vw - ${screenMin}rem) / (${screenMax} - ${screenMin}))), ${_fsMax}rem)`
}
*/
const path = require('path');
const fs = require('fs');
const glob = require('glob');
const srcDir = path.resolve(path.join(process.cwd(), 'src', 'components/_svg'));
const distDir = path.resolve(path.join(process.cwd(), 'src', 'components/_svg'));
function readSVG(file) {
return fs.readFileSync(file, 'utf-8');
}
/*
* Tailwind Prose Settings
*/
const settings = require('./tailwind.settings');
const settingsColors = require('./tailwind.settings.colors');
const colorMap = {
colorDefault: settingsColors.gray['700'],
colorLead: settingsColors.gray['600'],
@davidhellmann
davidhellmann / input.scss
Created February 17, 2021 07:01
Generated by SassMeister.com.
.foo {
@for $i from 1 through 24 {
@if $i % 2 == 0 {
&--size-#{$i} {
grid-column: #{(24 - $i) / 2} / span #{$i};
grid-row: #{(24 - $i) / 2} / span #{$i};
}
}
}
}
@davidhellmann
davidhellmann / lazy.ts
Last active February 6, 2021 10:02 — forked from mauricerenck/lazy.ts
export const initLazyloading = (selector: string): void => {
let images = document.querySelectorAll(selector);
if ('IntersectionObserver' in window) {
// Create new observer object
let lazyImageObserver = new IntersectionObserver((entries, observer) => {
// Loop through IntersectionObserverEntry objects
entries.forEach((entry) => {
// Do these if the target intersects with the root
if (entry.isIntersecting) {
@davidhellmann
davidhellmann / input.scss
Created February 3, 2021 12:53
Generated by SassMeister.com.
.foo {
@for $i from 1 through 24 {
@if $i % 2 == 0 {
&--size-#{$i} {
grid-column: #{(24 - $i) / 2} / span #{$i};
grid-row: #{(24 - $i) / 2} / span #{$i};
}
}
}
}
@davidhellmann
davidhellmann / input.scss
Created February 3, 2021 12:50
Generated by SassMeister.com.
.foo {
@for $i from 1 through 24 {
&--size-#{$i} {
grid-column: #{(24 - $i) / 2} / span #{$i};
grid-row: #{(24 - $i) / 2} / span #{$i};
}
}
}
@davidhellmann
davidhellmann / input.scss
Created February 2, 2021 23:58
Generated by SassMeister.com.
// Colors
@import '../02-tools/tools.mixin.create-css-vars';
$colors: (
'black': '#000',
'white': '#fff',
'ci': (
'blue': '#0095DB',
'blue-light': '#B9E4FA',
'black': '#222',
@davidhellmann
davidhellmann / input.scss
Created February 1, 2021 21:26
Generated by SassMeister.com.
.foo {
@for $i from 1 through 24 {
&--size-#{$i} {
grid-column: calc(#{ 25 - $i} /2) / span #{$i};
grid-row: calc(#{25 - $i} / 2) / span #{$i};
}
}
}
@davidhellmann
davidhellmann / input.scss
Created February 1, 2021 21:24
Generated by SassMeister.com.
@for $i from 1 through 24 {
&--size-#{$i} {
grid-column: calc((25 - #{$i}) /2) / span #{$i};
grid-row: calc((25 - #{$i}) / 2) / span #{$i};
}
}