npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bootstrap-font-sizes

v1.0.0

Published

Bootstrap 4 font size classes generated for each breakpoint.

Downloads

6

Readme

Bootstrap Font Sizes

This package generates font-size classes for defined pixels for all breakpoints in Bootstrap 4. It is useful for designs where the font size of a text is not linearly scaled and using REM is not helping. For example if you are using REM for spacing (.p/.m classes) and for font sizes the texts are unreadable on smaller resolutions when you scale down the base font size. By using for example font-size-20 font-size-md-16 classes you can fix this issue.

By default the SCSS generates font-size classes based on your $grid-breakpoints map. If you modify the required breakpoints for your project the change will be applied accordingly for font-size classes too.

Options

$max-font-size

By default the code is generating classes from 100 to 0 with font-size: 100px to font-size: 0px values for each breakpoint. It is rare case that you will need all these classes generated. To change the maximum limit of the generated font sizes you can use the variable $max-font-size. Changing the value will generate font-size classes from the specified value to 0 by default or the specified minimum by $min-font-size.

$min-font-size

Similarly to $max-font-size you can change the lowest generated font size.

$font-sizes

Lists of all font-size classes that will be generated for each breakpoint. This list overwrites the $max-font-size and $min-font-size options. Example:

$font-sizes: (36, 24, 20, 16, 14, 12, 10);

Example output

Below you can see the output for the following font sizes:

$font-sizes: (16, 12);
@import "node_modules/bootstrap-font-sizes/font-sizes";

Output

.font-size-16 {
  font-size: 16px !important; }
.font-size-12 {
  font-size: 12px !important; }

@media (min-width: 576px) {
  .font-size-sm-16 {
    font-size: 16px !important; }
  .font-size-sm-12 {
    font-size: 12px !important; } }

@media (min-width: 768px) {
  .font-size-md-16 {
    font-size: 16px !important; }
  .font-size-md-12 {
    font-size: 12px !important; } }

@media (min-width: 992px) {
  .font-size-lg-16 {
    font-size: 16px !important; }
  .font-size-lg-12 {
    font-size: 12px !important; } }

@media (min-width: 1200px) {
  .font-size-xl-16 {
    font-size: 16px !important; }
  .font-size-xl-12 {
    font-size: 12px !important; } }