User intent is the absolute guiding principle that supersedes all other considerations. Understanding this intent fully, correctly, and completely is the first and most critical responsibility in every interaction.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@use 'sass:string'; | |
@use 'sass:meta'; | |
@function var-if($cond-var, $true-val, $false-val) { | |
$id: string.unique-id(); | |
@return string.unquote('var(--#{$id}, #{$false-val}); --#{$id}: var(#{$cond-var}) #{$true-val}'); | |
} | |
@function var-toggle($bool) { | |
@return if($bool, string.unquote('/*!*/ /*!*/'), initial); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect, useRef, useState } from 'react'; | |
import { subscribeToQuery } from 'datocms-listen'; | |
import { useRouter } from 'next/router'; | |
import { reporter } from '../utils'; | |
/* | |
references for this technique of using router.replace | |
- https://www.joshwcomeau.com/nextjs/refreshing-server-side-props/ | |
- https://twitter.com/flybayer/status/1333081016995622914 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"scripts": [], | |
"styles": [] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createSlot() { | |
const Slot = ({ children }) => children; | |
const getSlot = (children) => | |
React.Children.toArray(children).find((child) => child.type === Slot) || | |
null; | |
return [Slot, getSlot]; | |
} | |
function createSlots(n) { | |
const SlotSets = Array(n) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"scripts": [],"showConsole": true} |
the most viable solutions are here
- Better Performance using Dynamic Code Splitting in Gatsby with loadable-components - DEV
- An SEO approach to async components with loadable-components - LogRocket Blog
- Getting Started - Loadable Components
- loadable-components/main.js at master · gregberge/loadable-components
- hector-del-rio/gatsby-plugin-loadable-components-ssr: Gatsby plugin for using @loadable/component with Gatsby's SSR
- [pristas-peter/gatsby-plugin-graphql-component: Query React Components in Gatsby GraphQL queries](https://
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@use 'sass:math'; | |
@use 'sass:list'; | |
@use 'sass:map'; | |
$theme: ( | |
breakpoints: ( | |
s: 20em, // 320 px alt: 20,30,45,60,75,90 | |
m: 32em, // 512 px | |
ml: 48em, // 768 px | |
l: 64em, // 1024 px |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const yn = require('yn'); | |
function confirm(message, callback) { | |
process.stdin.setEncoding('utf8'); | |
process.stdin.resume(); | |
process.stdout.write(`Confirm: ${message} [Y]`); | |
process.stdin.once('data', function(data) { | |
var ok = yn(data) || data.trim() == ''; | |
try { callback(ok); } catch (e) { throw new Error(e); } | |
process.stdin.pause(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function syncToFrames(el, eventName, frameCB, postFrameCB) { | |
let active = false; | |
function deactivate() { active = false; } | |
function activate() { | |
if (!active) { | |
setTimeout(onPostFrame); | |
requestAnimationFrame(onFrame); |
NewerOlder