Code Monkey home page Code Monkey logo

fluid-typography-calculator's Introduction

Fluid Typography Calculator ๐Ÿงฎ

Instructions

How to Use This Calculator

  • Enter min and max font sizes in px or rem. Your base font will always remain within these limits

  • Enter your min and max viewport widths in px or rem.

  • If the viewport is less than or equal to the minimum width and vice versa. In between these limits, font size will scale in proportion to the client's viewport width

  • The Result panel shows the generated formula that you can copy into your CSS

Confused about fluid typography?

Read my post, "Fluid Typography" which explains how this calculator works in detail

Credits ๐Ÿ‘

This calculator is inspired by Christopher Kirk-Nielsen's post, "Modern Fluid Typography with Clamp()"

For another fallback strategy that matches clamp's functionality, see Daniel Yuschick's "Fluid Typography with CSS Clamp() is My New Favorite Thing"

fluid-typography-calculator's People

Contributors

royalfig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

fluid-typography-calculator's Issues

calculation with rem and container query units

It would be better if the font size was calculated using a linear function in my opinion.
For example:
If the width of the container is 14rem then the font size should be 1rem. If the container is 60rem wide, then the font size should be 1.25rem.
Then you could calculate a linear function using the two points (14/1) and (60/1.25) and the font size should then change depending on the width of the container and the font size set by the user in the browser.
What do you say to this?

e.g.

p {
font-size: calc((100cqi/280) + 17px) / 16 * 1rem;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.