Socket
Socket
Sign inDemoInstall

font-weight-from-name

Package Overview
Dependencies
0
Maintainers
4
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    font-weight-from-name

> ⚖ Get the font weight number from common names


Version published
Weekly downloads
2
Maintainers
4
Install size
4.39 kB
Created
Weekly downloads
 

Readme

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

Last updated on 09 Oct 2017

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc