Coder Social home page Coder Social logo

fittext's Introduction

Compass extenstion / Sass mixin for inflating web type by generating media queries with progressively larger font sizes.

Example on my personal site.

Installation

From the command line:

gem install fittext

(depending on your ruby setup you may need to run sudo gem install fittext)

Installing into your project:

# Edit config.rb and add:
require "fittext"

# Import the extension into your sass or scss file
@import "fittext"

Arguments

@include fittext($min-media, $max-media, $min-font-size, $max-font-size, $media-increment, $font-increment, $ratio, $round)

$min-media

The smallest, and first media query generated

$max-media

Largest, and final media query generated (unless $max-font-size is reached first)

$min-font-size and $max-font-size

$min-font-size sets font size for the first media query, $max-font-size for the max.

$media-increment

Set increase between media queries. $media-increment: 150px would generate:

@media screen and (min-width: 300px) { ... }
@media screen and (min-width: 450px) { ... }
@media screen and (min-width: 600px) { ... }

$font-increment

Sets increase amount of font size for each media queries.

$ratio

An extra value to get font sizes to increase non-linearly. Default 1.

$round

Boolean. Rounds font size with ceil(). Default false.

Usage

h1
  font-size: 6em // For browsers that don't support media queries.
  @include fittext($min-media: 200px, $max-media: 1400px, $min-font-size: 5em, $max-font-size: 50em, $media-increment: 100, $font-increment: 1.5, $ratio: 1, $round: false)

fittext's People

Contributors

bookcasey avatar

Watchers

James Cloos avatar 262media avatar

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.