Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
tailwind-fluid-typography
Advanced tools
Based on the fluid typography theory devised by Mike Riethmuller and incorporating ideas from Google's Material Design spec, Tailwind Fluid Typography gives you a new set of utility classes that scale modularly depending on screen size.
npm i tailwind-fluid-typography
// or
yarn add tailwind-fluid-typography
// tailwind.config.js
module.exports = {
theme: {
fluidTypography: {},
},
plugins: [require("tailwind-fluid-typography")],
};
<h1 class="fluid-4xl">Fluid Typography @ 4XL</h1>
<h2 class="fluid-3xl">Fluid Typography @ 3XL</h2>
<h3 class="fluid-2xl">Fluid Typography @ 2XL</h3>
<h4 class="fluid-xl">Fluid Typography @ XL</h4>
<h5 class="fluid-lg">Fluid Typography @ LG</h5>
<h6 class="md:fluid-lg">Fluid Typography @ LG</h6>
<p class="fluid-base">Fluid Typography</p>
<p class="fluid-sm">Fluid Typography @ SM</p>
<small class="fluid-xs">Fluid Typography @ XS</small>
To customise the plugin settings, you can pass the following properties as part of a fluidTypography
property on theme
:
Name | Type | Default | Description |
---|---|---|---|
remSize | Number | 16 | The px size to assume for 1rem |
minScreenSize | Number | 320 | The screen size (in px) at which to begin scaling |
maxScreenSize | Number | 1920 | The screen size (in px) at which to stop scaling |
minTypeScale | Number | 1.2 | The scaling factor to use at minScreenSize |
maxTypeScale | Number | 1.333 | The scaling factor to use at maxScreenSize |
lineHeight | Number | 1.35 | The line-height to use for heading classes |
For example:
theme: {
fluidTypography: {
remSize: 14,
minScreenSize: 600,
maxScreenSize: 1280,
minTypeScale: 1.250,
maxTypeScale: 1.618,
lineHeight: 1.5
}
}
Minor Second | 1.067 | |
Major Second | 1.125 | |
Minor Third | 1.200 | default minTypeScale |
Major Third | 1.250 | |
Perfect Fourth | 1.333 | default maxTypeScale |
Augmented Fourth | 1.414 | |
Perfect Fifth | 1.500 | |
Golden Ratio | 1.618 |
At times, you may need to render fluid typography of which you don't have direct control over the classes. Because the style requirements of this vary greatly between sites, we haven't included the functionality in the plugin itself, but it is easily implemented in your own Tailwind stylesheet:
@layer utilities {
.fluid-prose {
:where(h1) {
@apply fluid-5xl mb-0;
}
:where(h2) {
@apply fluid-4xl mb-0;
}
:where(h3) {
@apply fluid-3xl mb-0;
}
:where(h4) {
@apply fluid-2xl mb-0;
}
:where(h5) {
@apply fluid-xl mb-0;
}
:where(h6) {
@apply fluid-lg mb-0;
}
}
}
In case you were wondering, the :where
selector comes with a CSS specificity of 0, so it is more easily overridden by other utility/custom classes than a normal <h1>
-style rule.
FAQs
Fluid typography plugin for the tailwindcss framework
The npm package tailwind-fluid-typography receives a total of 216 weekly downloads. As such, tailwind-fluid-typography popularity was classified as not popular.
We found that tailwind-fluid-typography demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.