Responsive Web Typography Crash Course

Responsive Web Typography Crash Course

Please watch the video.

For quick copy paste, take the following SCSS code and drop it into my (NEW) SCSS converter tool page!

//credit: PK (almostinevitable.com) 
//this one is the simplified version
@mixin awesome-pixel-sizes($desktop-size, $desktop-px, $mobile-size, $mobile-px) {
  ///desktop & mobile
  //$desktop-size: 1440;
  //$mobile-size: 780;
  $rem: 16;

  ///calcs
  $delta: ($desktop-px - $mobile-px) / ($desktop-size - $mobile-size); ///slope
  $delta-rounded: round($delta * 1000) / 1000; ///slope rounded.. round slope
  $deltavw: ($delta-rounded * 100);

  $intercept: ($mobile-px - ($delta-rounded * $mobile-size)); ///y intercept

  ///pixel based
  $calc-vw: (($desktop-px - $rem) * 100) / $desktop-size;
  $calc-01: (($calc-vw * $mobile-size) * .01) + $rem;
  $calc-01-rounded: round($calc-01 * 10000) / 10000;
  $final-rem: ($mobile-px / $calc-01-rounded);
  $final-rem-rounded: round($final-rem * 10000) / 10000;

  ///results
  ///for compatibility
  font-size: calc(#{$calc-vw}vw + #{$final-rem-rounded}rem);

  ////for clamps 
  @if $intercept < 0 {
    $thecalc: ($intercept * -1);
    font-size: clamp(#{$mobile-px}px, calc(#{$deltavw}vw - #{$thecalc}px), #{$desktop-px}px);
  } @else {
    $thecalc: $intercept;
    font-size: clamp(#{$mobile-px}px, calc(#{$deltavw}vw + #{$thecalc}px), #{$desktop-px}px);
  }
}

.single {
  h1 {
    line-height: 1.2;
    letter-spacing: .05em;
    margin: 2em 0 1em 0;
    @include awesome-pixel-sizes(1280, 54, 650, 24);
  }
  h2 {

  }
  h3 {

  }
  h4 {

  }
  h5 {

  }
  h6 {

  }
  p, 
  li {

  }
}

Here are the parent selectors you could use depending on your site builder of choice.

WIX 
	#site-root

Webflow 
	body.body

Squarespace	
	#siteWrapper
	#page 

Shopify - Debut
	body.template-index

Divi 
	#page-container 
	#et-boc

Elementor 
	body
	#main 

Beaver Builder 
	.fl-page
	#fl-main-content 

Oxygen
	body 
	#inner_content-11-1 (Change the numbers to work on your site)

Genesis 
	#genesis-content
	.site-content

Breakdance
	.breakdance

PS. Duda didn’t even load the templates for me to inspect, so… and that was even AFTER I went to the .com and realized that it’s not the page building service. .. what..? I don’t even remember what the TLD was. It’s THAT bad. So I didn’t include Duda in the list. Sorry, you’re worse than WIX and that’s saying something.

Please note: for Squarespace users

Squarespace uses LESS in its custom CSS entry field. So you can’t just drop in

calc(2.3vw + 1.2rem)

the numbers will calculate. whoops. So you’ll have to escape it into a string with a ~”” like this

calc(~"2.3vw + 1.2rem")

and it should work.

Impressed with the method? I have a lot more of these kinds of goodies in my SASS folder.

If you’re interested in SASS, you’re in luck!

Check this out!

Also, if you’re interested in getting started in CSS have a look at this.

There’s also a CSS package.

Lastly, if you want to go full-blown custom structure with your own custom theme, then have a look at this.

Get Breakdance

Breakdance is, in my opinion, the best page/site builder on the market, which is why all my tutorials use Breakdance. It's also why I have an affiliate link. You don't pay extra, but I get a little commission, so it helps support the site. Thanks!

Get ACF Pro

Another essential plugin for site building. This isn't an affiliate link, it's just for convenience.

Get WP Codebox Pro

If you'd like an easier to use, and more advanced code management plugin (instead of just editing and making files yourself) then WP codebox pro is for you. Adding php, js, and even SCSS. Pretty nice! Affiliate link below.

Blank Plugin

Sort of blank. It's made to be easy to use with the tutorials. Download and edit any way you see fit.
    Leave a Reply

    Your email address will not be published. Required fields are marked *

    New tutorials

    Auto-updating Year in Footer
    Designing Beyond the Brief
    Disable Gutenberg Editor on some ACF pages
    ACF flexible content fields in Breakdance 2.4

    Got a question? ask!

    If you have any question about the content on this page, feel free to send me an email by clicking the button below.

    newsletter? sign up!

    Sign up to the newsletter for updates on tutorials, news, and offers.

    Join the cypher!

    An awesome membership program for Breakdance Builder users coupled with an inclusive, friendly community.

    Got a question?

    If you have a question about something on this page, send me an email, and hopefully I can answer, and we can solve it!