New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

font-weight-from-name

Package Overview
Dependencies
Maintainers
4
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

font-weight-from-name

> ⚖ Get the font weight number from common names

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
4
Weekly downloads
 
Created
Source

font-weight-from-name

⚖ Get the font weight number from common names

Usage

import fontWeight from 'font-weight-from-name'

console.log(fontWeight('semibold')) // > 600
console.log(fontWeight('demi bold')) // > 600
// non-alpha characters are tossed, and capitalization is ignored
console.log(fontWeight('dEMi__ --- bOLD?!😉')) // > 600

Currently supported names/weights

⭐ Remember, capitalization and spacing doesn't matter.

WeightNames
100hairline, thin
200extralight, ultralight
300light
400normal, regular
500medium
600demibold, semibold
700bold
800extrabold, ultrabold
900black, heavy

Did we miss something? Create an issue and let's get it added.

Install

With Yarn or npm installed, run:

yarn add font-weight-from-name

# ...or, if using `npm`
npm install font-weight-from-name

Acknowledgments

font-weight-from-name was inspired by dan-gamble/postcss-font-weight-names

License

MIT

FAQs

Package last updated on 09 Oct 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc