css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <section class="hero">
  <div class="row">
  	<div class="small-12 column">
    	<h1>Fluid Typography</h1>
    </div>
  </div>
</section>

<section class="content">
      <div class="row">
        <div class="small-12 column">
          <p>Unlike responsive typography, that changes size only at defined breakpoints, fluid typography will resize smoothly to match the screen width.</p>
          <h3>Adding fluid typography to Foundation 6</h3>
            <p>This example works with Foundation's breakpoints to progressively scale the font size between breakpoint medium (640px) and breakpoint xxlarge (1440px), and set a fixed size for above and below these breakpoints. The $font-min-px and $font-max-px variables can be adjusted to suit your project, all else will automagically scale accordingly.</p>
					<p>Variables for the base font and size:</p>
					<div class="callout">
					<p>
						<code>$base-font: helvetica, sans-serif;</code><br>
						<code>$base-size: 1;</code> <span class="comment">// rem value</span>
					</p>
					</div>
		
					<p>Variables for minimum and maximum font sizes:</p>
					<div class="callout">
					<p>
						<code>$font-min-px: 12;</code> <span class="comment">// px value</span><br>
						<code>$font-max-px: 18;</code> <span class="comment">// px value</span>
					</p>
					</div>
					<p>Value conversions:</p>
					<div class="callout">
					<p>
						<code>$font-min: $font-min-px / ($base-size * 16);</code><br>
						<code>$font-max: $font-max-px / ($base-size * 16);</code>
					</p>
					</div>
					<p>Breakpoint includes and fluid type calculations:</p>
					<div class="callout">
					<p>
						<code>@include breakpoint(small) { body { font-family: $base-font; font-size: #{$font-min}rem; } }<br>
							@include breakpoint(medium) { body { font-size: #{$base-size}rem; font-size: calc(#{$font-min}rem + (#{$font-max-px} - #{$font-min-px}) * ((100vw - 640px) / 800)); } }<br>
							@include breakpoint(xxlarge) { body { font-size: #{$font-max}rem; } }
						</code>
					</p>
					</div>
        </div>
      </div>
</section>
            
          
!
            
              
$base-font: helvetica, sans-serif;
$base-size: 1; // rem value

$font-min-px: 12; // px value
$font-max-px: 20; // px value

$font-min: $font-min-px / ($base-size * 16);
$font-max: $font-max-px / ($base-size * 16);

// media queries have been modified for codepen

@media screen and (min-width: 0) { body { font-family: $base-font; font-size: #{$font-min}rem; } }
@media screen and (min-width: 640px) { body { font-size: #{$base-size}rem; font-size: calc(#{$font-min}rem + (#{$font-max-px} - #{$font-min-px}) * ((100vw - 640px) / 800)); } }
@media screen and (min-width: 1440px) { body { font-size: #{$font-max}rem; } }


h1 { font-size: 200%; font-weight: 400; }
h2 { font-size: 160%; font-weight: 400; }
h3 { font-size: 120%; font-weight: 400; }

.hero { margin-top: 2em; }
.content { margin-bottom: 2em; }
            
          
!
            
              $(document).foundation();
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console