Fittext
Compass extension / Sass mixin to create progressively larger media queries and font-sizes—no JavaScript neccessary!
Install / Use
/learn @bookcasey/FittextREADME
Fittext
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)
Related Skills
node-connect
350.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
350.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
350.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
