somascope
11/24/2018 - 2:33 AM

CSS responsive font-size

:root {
  /*
  Basis: use calc() and include a base size + a viewport width value
  calc(#size + #vw)
  */
  
  /* example 1 */
  font-size: calc(0.6em + 1vw);
  
  /* example 2 */
  font-size: calc(10px + 0.33vw);
}

/* use rems in your classes */
.panel {
  font-size: 1rem;
  padding: 1em;
  border-radius: 0.5em;
  border: 1px solid #999;
}