Skip to content

Instantly share code, notes, and snippets.

@jeremyfrank
jeremyfrank / puppeteer-script.js
Created July 9, 2023 18:56
Puppeteer config for modal cookie suppression with Lighthouse CI
/**
* @param {puppeteer.Browser} browser
* @param {{url: string, options: LHCI.CollectCommand.Options}} context
*/
module.exports = async (browser, context) => {
const cookies = [{
name: 'COOKIE_NAME_HERE',
value: 'COOKIE_VALUE_HERE',
url: context.url,
}]
@jeremyfrank
jeremyfrank / lighthouserc.js
Created July 9, 2023 18:52
Lighthouse CI config for running lighthouse on multiple URLs
/*
* Lighthouse CI configuration docs:
* https://github.com/GoogleChrome/lighthouse-ci/blob/main/docs/configuration.md
*/
module.exports = {
ci: {
collect: {
// numberOfRuns: 1, // uncomment this line for testing
@jeremyfrank
jeremyfrank / typography.js
Created February 2, 2023 19:33
Fluid Typography Tailwind Plugin
const plugin = require('tailwindcss/plugin')
const isPlainObject = require('tailwindcss/lib/util/isPlainObject').default
const { rem } = require('@viget/tailwindcss-plugins/utilities/fns')
/**
* Outputs various typography styles as Tailwind components
*
* .heading-NAME-SIZE
* .body-text-SIZE
* .ui-text-SIZE
@jeremyfrank
jeremyfrank / animation-delay.js
Created February 24, 2022 14:13
Animation delay plugin for Tailwind CSS
const plugin = require('tailwindcss/plugin')
module.exports = plugin(({ addUtilities, e, theme }) => {
const pluginConfig = theme('animationDelay', {})
const utilities = Object.entries(pluginConfig).map(([name, value]) => {
return {
[`.${e(`animation-delay-${name}`)}`]: {
animationDelay: value,
},