sca

[ASAP] Chip-Scale Reconfigurable Optical Full-Field Manipulation: Enabling a Compact Grooming Photonic Signal Processor

ACS Photonics
DOI: 10.1021/acsphotonics.0c00103




sca

[ASAP] Probing the Radiative Electromagnetic Local Density of States in Nanostructures with a Scanning Tunneling Microscope

ACS Photonics
DOI: 10.1021/acsphotonics.0c00264




sca

[ASAP] Line-Scan Hyperspectral Imaging Microscopy with Linear Unmixing for Automated Two-Dimensional Crystals Identification

ACS Photonics
DOI: 10.1021/acsphotonics.0c00050




sca

[ASAP] Strong Optical Feedback Stabilized Quantum Cascade Laser

ACS Photonics
DOI: 10.1021/acsphotonics.0c00189




sca

A Modern Typographic Scale

Rob Weychert reaches for the top notes to sing us a song of typographic scale. A little attention to scale and to the mathematics will help you to hit a high note with your designs this Christmas and beyond.


I’ve been studying music theory this year. While some of its core concepts were already familiar to me, much of their specifics were not. Or so I thought. A funny thing happened when I was learning the major scales.

While playing through a song I had written some years before, I started picking it apart to see how it correlated with the theory I was learning. I had composed the melody without any thought to what the specific notes were, but as I started to transcribe them, a pattern quickly emerged: all the B’s and E’s were flat and the rest of the notes were natural. Lo and behold, long before my music theory studies began, I had written a song in B♭ major. My ears already knew how the major scales worked even if my brain didn’t. (If you know how “do re mi fa so la ti do” is supposed to sound tonally, then your ears know, too.)

When music is composed to a scale, it sounds “right” to us. And just as our ears appreciate harmony and melody with a rational basis, our eyes can appreciate the same concepts applied to spatial relationships.

Have you ever struggled with sizing type in a design project, especially when you need more than just one or two sizes? Have you ever despaired at the number of ad-hoc type sizes on your site spiraling out of control over time? It could be that you’ve been composing the typographic equivalent of a cacophonous symphony. And the first thing any composer will tell you to do is to get that thing on a scale.

Meet the typographic scale

You don’t need to know music theory to work with a typographic scale. You only need to know that a scale is a range of values with an established mathematic relationship. For a typographic scale, that relationship is frequently a steady interval between type sizes. Depending on what you need your type to do, the interval might be fixed (e.g. each size is two pixels bigger than the size before it) or it might be proportional (e.g. each size is twice as big as the size before it). I personally rarely find fixed intervals useful, so I’ll be focusing on proportional intervals.

The most important thing to understand about proportional intervals is thankfully not complicated: The bigger the intervals are, the more drastic the size differences will be in your scale. If your layout calls for contrast, a bigger interval might be the way to go. If you’re aiming for something more nuanced, go smaller. But keep these things in mind:

  • There is such a thing as too much nuance: if a size on your scale is virtually indistinguishable from the sizes adjacent to it, it defeats the purpose of using a scale.
  • On the flip side, too much contrast renders the sizes’ proportional relationship moot. At a certain point, massive display type is arguably more graphic than textual.
  • More is less. The more sizes you use, the less they’ll mean.
A small interval (left, 1.1) offers a smoother range of sizes; a large interval (right, 1.8) offers more contrast.

Setting up the scale variables

The quickest way to get a scale up and running when working on the web is to drop its values into some CSS variables. The naming convention I typically use begins with --scale0, which is the body text size. The size below it is --scale-1 (as in “scale minus one”), the size above it is --scale1, and so on. Keeping the names relative to each other like this helps me move around the scale intuitively as I use it. If, say, --scale4 isn’t big enough for my h1, I can move up to --scale5 or --scale6, and I always know exactly how many steps away from the body text I am. Here’s a first pass at a simple set of scale variables using an interval of 1.5:

:root {
  --scale-2: 7.1px;  /* 10.7 ÷ 1.5 */
  --scale-1: 10.7px; /* 16 ÷ 1.5   */
  --scale0: 16px;    /* body text  */
  --scale1: 24px;    /* 16 × 1.5   */
  --scale2: 36px;    /* 24 × 1.5   */
}

I can use these variables with any CSS property that accepts a numeric value, like so:

p { font-size: var(--scale0); }

Rooting around in rems

I’m off to a good start. However, those px values are a little too absolute for my liking. If I convert them to rems, it’ll give my scale more flexibility. rem stands for “root em.” 1rem is equivalent to the html element’s text size, which in most browsers defaults to 16px. Crucially, though, users can adjust that size in their browser settings, and using rems in my CSS will respect those preferences.

:root {
  --scale-2: 0.4rem;  /* 0.7rem ÷ 1.5 */
  --scale-1: 0.7rem;  /* 1rem ÷ 1.5   */
  --scale0: 1rem;     /* body text    */
  --scale1: 1.5rem;   /* 1rem × 1.5   */
  --scale2: 2.25rem;  /* 1.5rem × 1.5 */
}

Another benefit of the relative nature of rems: I tend to use larger text sizes on large viewports and smaller text sizes on small viewports. Rather than adjusting dozens or hundreds of typographic CSS declarations per breakpoint, I can shift the whole scale up or down merely by adjusting the font-size on the html element:

html { font-size: 100%; }     /* 1rem = 16px */

@media screen and (min-width: 25em) {
  html { font-size: 112.5%; } /* 1rem = 18px */
}

Calculating with calc()

My scale is coming along. Its variables’ intuitive names make it easy for me to use, and its rem values respect the user’s browser preferences and allow me to easily shift the size of the entire scale at different viewport sizes. But my setup still isn’t optimized for one very important adjustment: the interval, which is currently 1.5. If 1.5 isn’t quite working for me and I want to see how an increase or decrease will affect the scale, I need to do the math all over again for every step in the scale every time I adjust the interval. The bigger the scale, the more time that will take. It’s time to put down the abacus and get calc() involved.

:root {
  --int: 1.5;
  --scale0: 1rem;
  --scale-1: calc(var(--scale0) / var(--int));
  --scale-2: calc(var(--scale-1) / var(--int));
  --scale1: calc(var(--scale0) * var(--int));
  --scale2: calc(var(--scale1) * var(--int));
}

My interval now has its very own variable, called --int. calc() determines each scale size by multiplying the preceding size by --int. Now that every size is ultimately dependent on --scale0’s value, --scale0 must appear first in the list. Since the sizes smaller than --scale0 are going down rather than up, their values require division rather than multiplication.

Scaling the scale

I can now quickly and easily tweak my scale’s interval by adjusting --int until the proportions are just right, but if I want to add more sizes to the scale, I need to add more variables and calc() values. This isn’t too big of a deal, but if I want to double or triple the number of sizes, it’s kind of a headache. Luckily, this is the sort of thing Sass is really good at. In the following code, adjusting the first four Sass variables at the top of :root will quickly spin up a set of CSS variables like the scale above, with any interval (proportional or fixed) and any number of scale sizes:

:root {
  $interval: 1.5;    // Unitless for proportional, unit for fixed
  $body-text: 1rem;  // Must have a unit
  $scale-min: -2;    // Unitless negative integer
  $scale-max: 2;     // Unitless positive integer

  --int: #{$interval};
  --scale0: #{$body-text};

  @if $scale-min < 0 {
  // Generate scale variables smaller than the base text size
    @for $i from -1 through $scale-min {
      @if type-of($interval) == number {
        @if unitless($interval) {
          --scale#{$i}: calc(var(--scale#{$i + 1}) / var(--int));
        } @else {
          --scale#{$i}: calc(var(--scale#{$i + 1}) - var(--int));
        }
      }
    }
  }
  @if $scale-max > 0 {
    // Generate scale variables larger than the base text size
    @for $i from 1 through $scale-max {
      @if type-of($interval) == number {
        @if unitless($interval) {
          --scale#{$i}: calc(var(--scale#{$i - 1}) * var(--int));
        } @else {
          --scale#{$i}: calc(var(--scale#{$i - 1}) + var(--int));
        }
      }
    }
  }
}

Go forth and scale

Typographic scales have been an indispensable part of my work for many years, and CSS variables and calc() make setup, adjustments, and experimentation easier than ever. I hope you find these techniques as useful as I do!


About the author

Rob Weychert is a Brooklyn-based designer. He helps shape the reading experience at ProPublica and has previously helped make books at A Book Apart, games at Harmonix, and websites at Happy Cog. In his free time, he obsesses over music and film. Despite all this, he is probably best known as a competitive air guitarist.

More articles by Rob




sca

Teachers' recruitment scam: Chautala surrenders before Tihar jail authorities

Chautala was granted interim bail by the HC on July 23 for six weeks on medical ground.




sca

Fodder Scam: Day before verdict, RJD prays, Lalu Yadav skirts media

The question of who would replace Lalu as RJD chief should he be convicted was not considered.




sca

Lalu Prasad Yadav convicted in fodder scam case, taken to jail in Ranchi

Lalu's conviction rendered him ineligible for contesting elections for at least six years.




sca

Fodder scam: Lalu Prasad taken to Birsa Munda Central jail

The court has fixed October three for pronouncement of sentence against Yadav.




sca

Law catches up with Lalu, faces at least 3 years in jail in fodder scam case

RJD chief Lalu Prasad would also automatically cease to be a Lok Sabha member if sentenced to over two years.




sca

Scared to return home, hundreds seek transfer certificates for kids

Parents unwilling to return home, sought help of camp organisers to let kids to study elsewhere.




sca

Srinagar encounter ends, militants escape

Four more cops sustained minor injuries in the exchange of fire between the two sides.




sca

Earthquake measuring 5 on Richter scale jolts Sikkim

In Gangtok some buildings had developed cracks and people were out on the streets.




sca

Fodder Scam: Rabri will guide us in Lalu's absence as she did in the past, says RJD

Lalu will come out unscathed and lead us once again in future, Ramkripal Yadav said.




sca

CVC declines information on Leave travel concession scam

CBI is carrying out a preliminary enquiry in the case and has questioned several travel agents.




sca

'Jailed' Lalu moves Jharkhand High Court against conviction in fodder scam case

The RJD chief has been ordered rigorous imprisonment for five years by the CBI court.




sca

Fodder scam case: Inside the Chaibasa treasury

Post the fodder scam-allotment details are now online, once influential posts have lost power.




sca

After Nitish's dig at Modi, BJP hits back over silence on 'Cong scams', IM terror

A man who aspires to be at the highest position of India should be patient, Nitish says.




sca

Mayawati gets clean chit in Noida farmhouse scam case

In Aug, UP govt had ordered a probe by the Lokayukta in the farmhouse allotment.




sca

Saradha scam: Suspended TMC MP Kunal Ghosh arrested

Ghosh, who was apprehending arrest since Friday, went to lodge a complaint against Arnab Ghosh.




sca

CWG scam: PMO refuses info on Shunglu recommendations on CAG

Commonwealth Games were held from December 3-14, 2010 in the national capital.




sca

Lalu Yadav to walk out of jail as SC grants him bail in fodder scam case

SC granted bail after noting that several other convicts have already been granted bail in the case.




sca

Extending the Scalability of Linkage Learning Genetic Algorithms [electronic resource] / Ying-ping Chen

Secaucus : Springer, 2006




sca

Developments in language theory [electronic resource] : 10th international conference, DLT 2006, Santa Barbara, CA, USA, June 26-29, 2006 : proceedings / Oscar H. Ibarra, Zhe Dang (eds.)

Berlin ; New York : Springer, [2006]




sca

Curve e superfici [electronic resource] / by Marco Abate, Francesca Tovena

Milano : Springer Milan : Imprint: Springer, 2006




sca

Advances in energy systems : the large-scale renewable energy integration challenge / edited by Peter D. Lund (Aalto University, Finland) [and three others]




sca

Absurdistan : a bumpy ride through some of the world's scariest, weirdest places / Eric Campbell

Campbell, Eric, 1960-




sca

Chit Fund Scam: Mamata govt proposes stringent measures in new bill



  • DO NOT USE West Bengal
  • India

sca

Saradha scam: Debjani Mukherjee denies intimate relation with Sudipta Sen



  • Cities
  • DO NOT USE West Bengal

sca

Saradha scam: HC refuses CBI probe into chit fund case at present stage



  • DO NOT USE West Bengal
  • India

sca

Saradha scam: Suspended TMC MP Kunal Ghosh writes to ED, fears for life



  • DO NOT USE West Bengal
  • India

sca

Saradha scam: Biman Bose asks Mamata Banerjee to be ready for CBI grilling



  • DO NOT USE West Bengal
  • India

sca

Saradha scam: I am not involved in any immoral act in my life, says Mukul Roy



  • DO NOT USE West Bengal
  • India

sca

Saradha Scam: CBI asks Mukul Roy to appear on January 28



  • DO NOT USE West Bengal
  • India

sca

ALTA 2001 Nickel/Cobalt-7 : technical proceedings : 15-18th May, 2001, Hotel Rendezvous,Observation City, Scarborough Beach, Perth, Western Australia




sca

Copper oxide ore heap leaching testwork and scale-up short course / presented by Alan Taylor




sca

158 JSJ Roots with Jeff Escalante

02:30 - Jeff Escalante Introduction

03:15 - Roots

05:20 - Static Sites vs Dynamic Sites

13:47 - Plugins

15:48 - Multipass Compile Functionality

20:27 - Roots vs Other Static Site Generators

22:31 - Netlify

26:22 - HTTPS

Picks

ECMAScript 6 — New Features: Overview & Comparison (Aimee)
Jacob Kaplan-Moss: Keynote at Pycon 2015 (Aimee)
Dr. Who (AJ)
Power Rangers (AJ)
Marvel Digital Comics Unlimited (Joe)
GoFundMe (Joe)

Netlify (Jeff)
accord (Jeff)
Contentful (Jeff) 




sca

MJS 075: Jeff Escalante

Show notes coming shortly!




sca

JSJ 386: Gatsby.js with Chris Biscardi

Sponsors

  • GitLab | Get 30% off tickets with the promo code: DEVCHATCOMMIT

  • Sentry– use the code “devchat” for $100 credit 

Panel

  • Chris Beucheler

  • AJ O’Neal

  • Aimee Knight

With Special Guest: Chris Biscardi

Episode Summary

Chris is an independent consultant working with open source startups. He taught himself to program and started in open source. He talks about how he got into programming and how he learned to code. One of Chris’ current clients is Gatsby, a static site generator. Chris talks about his work with Gatsby themes, how he got started working with Gatsby, and how you can get started with Gatsby. Chris talks about how Gatsby differs from other static site generators and how difficult it is to use. The panel discusses possible use cases for Gatsby, and agree that if your site is going to get more complex and larger over time, something like Gatsby is what you want to use. Chris talks about what it’s like to migrate to Gatsby from another service. The panel discusses the pros and cons of server-side rendering. Chris talks about building more app-oriented sites with Gatsby and things that you can plug into a Gatsby theme besides a blog. The show concludes with Chris and the panelists agreeing that if you can write it in JavaScript, you can ship it in a Gatsby theme. 

Links

Follow DevChat on Facebook and Twitter

Picks

AJ O’Neal:

Aimee Knight:

Chris Beucheler:

Chris Biscardi:




sca

MJS 131: Chris Biscardi

Chris is an independent consultant working with open source startups. He taught himself to program and started in open source. He talks about how he got into programming and how he learned to code.

Chris' first access to programming was writing index.hml files when he was younger and again when he was majoring in Arts in university he was introduced to ActionScript.

Host: Charles Max Wood

Joined by Special Guest:  Chris Biscardi

Sponsors

_______________________________________________________

"The MaxCoders Guide to Finding Your Dream Developer Job" by Charles Max Wood will be out on November 20th on Amazon. Get your copy on that date only for $2.99

_______________________________________________________

Links

Picks

Charles Max Wood:

Chris Biscardi:

  • Follow Chris on Instagram at ChrisBiscardi




sca

JSJ 418: Security Scary Stories and How to Avoid Them with Kevin A McGrail

In this episode of JavaScript Jabber the panel interviews security expert, Kevin A. McGrail. He starts by explaining what security frameworks and what they do. The panel wonders how to know if your developers are capable of self-auditing your security or if you need help. Kevin shares recommendations for companies to look at to answer that question. 

Aimee Knight explains the hell she has been in making changes to be compliant with CCPA. The panel considers how policies like this complicate security, are nearly impossible to be compliant with and how they can be weaponized. They discuss the need for technical people to be involved in writing these laws. 

Kevin explains how you can know how secure your systems actually are. He shares the culture of security first he tries to instill in the companies he trains. He also trains them on how to think like a bad guy and explains how this helps developers become security first developers. The panel discusses how scams have evolved and how the same scams are still being run. They consider the importance of automated training and teaching developers to do it right the first time.

Finally, they consider the different ways of authentication, passwords, passphrases, sim card, biometrics. Kevin warns against oversharing or announcing vacations. The panel discusses real-world tactics bad guys use. Kevin explains what he trains people to do and look out for to increase security with both social engineering and technical expertise. 

Panelists

  • Aimee Knight

  • AJ O’Neal

  • Charles Max Wood

  • Dan Shappir

  • Steve Edwards

Guest

  • Kevin A McGrail

Sponsors

____________________________________________________________

"The MaxCoders Guide to Finding Your Dream Developer Job" by Charles Max Wood is now available on Amazon. Get Your Copy Today!

____________________________________________________________

Links

Follow DevChatTV on Facebook and Twitter

Picks

Aimee Knight:

AJ O’Neal:

Dan Shappir:

Kevin A McGrail:

Steve Edwards:




sca

Youthscapes [electronic resource] : the popular, the national, the global / edited by Sunaina Maira and Elisabeth Soep




sca

Inpatient PCI Volume and Transcatheter Aortic Valve Replacement or Mitral Valve Repair Outcomes

This cross-sectional study investigates whether hospital inpatient percutaneous coronary intervention volume is associated with rates of 30-day risk-adjusted mortality and hospital readmission after transcatheter aortic valve replacement and transcatheter mitral valve repair.




sca

[ASAP] Condensation Induced Blistering as a Measurement Technique for the Adhesion Energy of Nanoscale Polymer Films

Nano Letters
DOI: 10.1021/acs.nanolett.0c01086




sca

[ASAP] Spatial Heterojunction in Nanostructured TiO<sub>2</sub> and Its Cascade Effect for Efficient Photocatalysis

Nano Letters
DOI: 10.1021/acs.nanolett.9b05121




sca

[ASAP] Atomic Scale Dynamics Drive Brain-like Avalanches in Percolating Nanostructured Networks

Nano Letters
DOI: 10.1021/acs.nanolett.0c01096




sca

[ASAP] Soft Polymeric Matrix as a Macroscopic Cage for Magnetically Modulating Reversible Nanoscale Ligand Presentation

Nano Letters
DOI: 10.1021/acs.nanolett.9b05315




sca

[ASAP] Ultrasmall Rhodium Nanozyme with RONS Scavenging and Photothermal Activities for Anti-Inflammation and Antitumor Theranostics of Colon Diseases

Nano Letters
DOI: 10.1021/acs.nanolett.9b05035




sca

[ASAP] In Liquid Infrared Scattering Scanning Near-Field Optical Microscopy for Chemical and Biological Nanoimaging

Nano Letters
DOI: 10.1021/acs.nanolett.0c01291




sca

[ASAP] Imaging Supramolecular Morphogenesis with Confocal Laser Scanning Microscopy at Elevated Temperatures

Nano Letters
DOI: 10.1021/acs.nanolett.0c00662