Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fluid-font-size

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fluid-font-size

This Sass mixin doesn't create just viewport-based font-sizes. The ratio between small font-sizes and large font-sizes is smaller at a smaller window width.

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

npm version

Fluid font-size

This Sass mixin doesn't create just viewport-based font-sizes. The ratio between small font-sizes and large font-sizes is smaller at a smaller window width. So you don't have problems with line-breaks at large headlines on mobile devices.

Usage

After installing with npm install fluid-font-size you can import it.

@import "node_modules/fluid-font-size/fluid-font-size.scss";

.foo {
  @include fluid-font-size(20px);
}

This will create something like:

.foo {
  font-size: 20px;
  font-size: calc(15.06173px + 0.5487vw);
  content: "viewport-units-buggyfill; font-size: calc(15.06173px + 0.5487vw)";
}

Wonder what the viewport-units-buggyfill stuff is? It's a polyfill for viewport units. So basically you'll have IE9 support with it.

Min and max font-size

Minimum and maximum font-sizes are also supported. Yay! 🎉

.foo {
  @include fluid-font-size(20px, (
    min: 15px,
    max: 25px,
  ));
}

Options

To change the intensity of the effect to influence the ratio between small and large font-sizes you can change the variable $fluid-font-size-ratio.

$fluid-font-size-ratio: 1;

To decrease the effect set it to an higher number than 1. To increase the effect decrease it to something between 0 and 1.

Keywords

FAQs

Package last updated on 17 Nov 2016

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