- Jump down to the plugin
- Try it on Codepen — and heart it!
- Try it on Tailwind Play
- Read my blog post about this plugin - and share it!
and star this gist!
import React from 'react'; | |
import { CookieConsentProvider } from './CookieConsent' | |
import Page from './Page' | |
function App() { | |
return ( | |
<CookieConsentProvider> | |
<div className="App"> | |
<Page /> | |
</div> |
spacing: { | |
"13": '3.25rem', | |
"15": '3.75rem', | |
"17": '4.25rem', | |
"18": '4.5rem', | |
"19": '4.75rem', | |
"76": "19rem", | |
"84": "21rem", | |
"88": "22rem", | |
"92": "23rem", |
const plugin = require("tailwindcss/plugin"); | |
module.exports = { | |
mode: "jit", | |
purge: { | |
content: ["./src/**/*.{js,ts,jsx,tsx,mdx,vue}"], | |
}, | |
theme: { extend: {} }, | |
variants: {}, | |
plugins: [ |
<?php | |
// From Marcel Pociot's tweet | |
// See: https://twitter.com/marcelpociot/status/1389881758267625473 | |
Str::macro('readDuration', function (... $text) { | |
$totalWords = str_word_count(implode(' ', $text)); | |
$minutesToRead = round($totalWords / 200); | |
return (int) max(1, $minutesToRead); |
/* If you've ever had the need to link directly to an open modal window with Bootstrap, here's a quick and easy way to do it: | |
Make sure your modal has an id: | |
<div class="modal" id="myModal" ... > | |
Then stick this bit of Javascript at at the end of your document: | |
*/ | |
$(document).ready(function() { |
@servers(['web' => ['user@my-server.com']]) | |
@setup | |
$env = isset($env) ? $env : 'dev'; | |
if ($env === 'dev') { | |
$dir = '/var/www/html/dev/my-laravel-app'; | |
} else if ($env === 'production') { | |
$dir = '/var/www/html/my-laravel-app'; | |
} |
const Test = () => { | |
return | |
( | |
<> | |
<div className="absolute top-0 right-0 p-4 text-right bg-white"> | |
ref: {swipeRef.current?.clientHeight} | |
<br /> | |
availHeight: {window.screen.availHeight} | |
<br /> | |
innerHeight: {window.innerHeight} |
{ | |
... | |
"scripts": { | |
"dev": "astro dev", | |
"start": "astro dev", | |
"build": "astro build", | |
"postbuild": "node ./postbuild.mjs -path ./", | |
"preview": "astro preview", | |
"astro": "astro" | |
}, |
function PlaceholderImage({ | |
height, | |
width, | |
...consumerProps | |
}) { | |
return ( | |
<img | |
{...consumerProps} | |
alt="" | |
src={`https://via.placeholder.com/${width}x${height}`} |
and star this gist!