Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
tailwindcss-font-size
Advanced tools
Tailwind CSS plugin to add font-size property in px and rem
A plugin that provides utilities for font-size by px
and rem
( px to rem ).
Deference between TailwindCSS's JIT(Just in Time) is that this plugin calculates the rem font-size based on the font-size of the root element.
<!-- TailwindCSS JIT -->
<p class="text-[22px]">Good</p>
<p class="text-[1.375rem]">🧮 Needs Calculation...</p>
<!-- This Plugin -->
<p class="fsz-22px">Good</p>
<p class="fsz-22ptr">🤓 No Calculation is Needed</p>
Install the plugin from npm:
# Using npm
npm install tailwindcss-font-size
# Using Yarn
yarn add tailwindcss-font-size
Then add the plugin to your tailwind.config.js
file:
// tailwind.config.js
module.exports = {
theme: {
// ...
},
plugins: [
require('tailwindcss-font-size'),
// ...
],
}
Use the fsz-{n}px
or fsz-{n}ptr
utilities to set font-size.
px
is for pixel, ptr
is for rem ( px to rem ).
<p class="fsz-32px">This font size is 32px</p>
<p class="fsz-32ptr">This font size is 2rem (if option.baseSize is 16px)</p>
You can configure the plugin by passing options to its constructor.
Parameters and default values are below.
// tailwind.config.js
module.exports = {
theme: {
// ...
},
plugins: [
require('tailwindcss-font-size')({
baseSize: 16, // html font-size
minSize: 10,
maxSize: 128
}),
// ...
],
}
Please feel free to open an issue or make a pull request.
Distributed under the MIT License. See LICENSE for more information.
FAQs
Tailwind CSS plugin to add font-size property in px and rem
The npm package tailwindcss-font-size receives a total of 1 weekly downloads. As such, tailwindcss-font-size popularity was classified as not popular.
We found that tailwindcss-font-size 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.