Fluid Typography
How do I make an fluid typography?
What is a fluid typography? How do you make a fluid typography? This script and codes were developed by Kevin on 13 October 2022, Thursday.
Fluid Typography - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Fluid Typography</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel='stylesheet prefetch' href='https://fonts.googleapis.com/css?family=Roboto"rel="stylesheet'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <h1>Lorem Ipsum</h1> --> -->
<h2>Lorem Ipsum</h2>
<h3>Lorem Ipsum</h3>
<h4>Lorem Ipsum</h4>
<h5>Lorem Ipsum</h5>
<h6>Lorem Ipsum</h6>
<p class="note">Lorem Ipsum</p>
<p>Lorem Ipsum</p>
</body>
</html>
Fluid Typography - Script Codes CSS Codes
//Responsive Typography
//Variables
@small-screen: 460px;
@large-screen: 1129px;
@base-font-size: 14px;
@ratio: 1.618;
//Fluid type mixin
.font-size(@min-screen: 460px, @max-screen: 1129px, @base-font: 14px, @min-font, @max-font) { //Min font font-size: @min-font; @line-height-min: @min-font * @ratio * 1; line-height: @min-font * @ratio; @media screen and (min-width: unit((@min-screen / @base-font), ~"em")) { //The fluid font sizing calc @font-calc: calc( @min-font ~" + " unit(@max-font - @min-font) ~" * ((100vw - " unit((@min-screen / @base-font), ~"em") ~") /" unit( (@max-screen / @base-font) - (@min-screen / @base-font)) ~")"); font-size: @font-calc; //@line-height: @font-calc * @ratio * 1; line-height: @font-calc * @ratio; } @media screen and (min-width: unit((@max-screen / @base-font), ~"em")) { // Max-font font-size: @max-font; @line-height-max: @max-font * @ratio * 1; line-height: @max-font * @ratio; }
}
//h1
.type-jumbo() { .font-size(@small-screen, @large-screen, @base-font-size, 1.8em, 2.4em);
}
//h2
.type-largest() { .font-size(@small-screen, @large-screen, @base-font-size, 1.6em, 2.2em);
}
//h3
.type-larger() { .font-size(@small-screen, @large-screen, @base-font-size, 1.4em, 2em);
}
//h4
.type-large() { .font-size(@small-screen, @large-screen, @base-font-size, 1.2em, 1.8em);
}
//h5
.type-small() { .font-size(@small-screen, @large-screen, @base-font-size, 1em, 1.6em);
}
//h6
.type-smaller() { .font-size(@small-screen, @large-screen, @base-font-size, .8em, 1.4em);
}
//.note class
.type-smallest() { .font-size(@small-screen, @large-screen, @base-font-size, .6em, 1.2em);
}
//body
.type-body() { .font-size(@small-screen, @large-screen, @base-font-size, 1em, 1em);
}
///END OF MIXIN
html { font-size: 100%;
}
h1,
h2,
h3,
h4,
h5,
h6,
p,
.note { margin: 10px;
}
body { .type-body; font-family: 'Roboto';
}
h1 { .type-jumbo;
}
h2 { .type-largest;
}
h3 { .type-larger;
}
h4 { .type-large;
}
h5 { .type-small;
}
h6 { .type-smaller;
}
.note { .type-smallest;
}
Developer | Kevin |
Username | gnarfugh |
Uploaded | October 13, 2022 |
Rating | 3 |
Size | 2,797 Kb |
Views | 18,216 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Slider | 5,806 Kb |
Hover icon link over image | 2,915 Kb |
Hamburger | 2,396 Kb |
Mess svg logo | 2,249 Kb |
Recommended class | 2,640 Kb |
React Scoreboard | 3,912 Kb |
Final responsive typography forever | 2,478 Kb |
Google Maps api | 2,795 Kb |
Old calculator | 2,815 Kb |
Flex dropdown nav | 3,962 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Atom | Bhlaird | 1,932 Kb |
RRC wrapSwitch | Pshrmn | 2,922 Kb |
Loading animation - freedom purchase | Rocbear | 2,567 Kb |
Pattern lab logo | TimPietrusky | 3,666 Kb |
Webkit decolorize | Fivera | 1,675 Kb |
SCSS Unit Conversion | Jakob-e | 8,210 Kb |
Promodoro | Bencarp | 1,712 Kb |
Sticky footer testing | 75th | 1,649 Kb |
V.35 The Monolith Update - Hero Release Notes | Jordan | 12,045 Kb |
Amazing CSS Menu with Notification Badges | Faizanasad | 2,549 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!