{"componentChunkName":"component---src-templates-term-jsx","path":"/responsive-design-glossary/fluid-typography/","result":{"data":{"mdx":{"body":"function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsxRuntime classic */\n\n/* @jsx mdx */\nconst _frontmatter = {\n  \"title\": \"Fluid typography\",\n  \"plural\": false\n};\nconst layoutProps = {\n  _frontmatter\n};\nconst MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  let {\n    components\n  } = _ref,\n      props = _objectWithoutProperties(_ref, [\"components\"]);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"p\", null, `With fluid typography, you use viewport units for your font sizes, either alone or as part of a `, mdx(\"code\", _extends({\n    parentName: \"p\"\n  }, {\n    \"className\": \"language-text\"\n  }), `calc()`), ` value. This will let your font size grow along with the size of the screen, keeping the two in balance.`), mdx(\"p\", null, `Because fluid typography sizes with the viewport, it's common to use a minimum and a maximum size to prevent text becoming too small or too large. There are various techniques for this, the easiest is to use media queries: up to a certain width, the size is fixed, after that, the size is either in `, mdx(\"code\", _extends({\n    parentName: \"p\"\n  }, {\n    \"className\": \"language-text\"\n  }), `vw`), `, or in a `, mdx(\"code\", _extends({\n    parentName: \"p\"\n  }, {\n    \"className\": \"language-text\"\n  }), `calc()`), `, for example, `, mdx(\"code\", _extends({\n    parentName: \"p\"\n  }, {\n    \"className\": \"language-text\"\n  }), `calc(1rem + 0.25vw)`), `, and at a certain viewport width, you define the maximum font size.`), mdx(\"p\", null, `An upcoming method is `, mdx(\"code\", _extends({\n    parentName: \"p\"\n  }, {\n    \"className\": \"language-text\"\n  }), `clamp()`), `, which will be introduced in browsers soon and lets you do this without media queries. For example `, mdx(\"code\", _extends({\n    parentName: \"p\"\n  }, {\n    \"className\": \"language-text\"\n  }), `clamp(1rem, 2.5vw, 1.75rem)`), ` can be used to get a font-size that's 2.5vw, with a minimum of 1rem and a maximum of 1.75rem.`));\n}\n;\nMDXContent.isMDXComponent = true;","excerpt":"With fluid typography, you use viewport units for your font sizes, either alone or as part of a  calc()  value. This…","frontmatter":{"title":"Fluid typography","plural":false,"determiner":null},"fields":{"slug":"/responsive-design-glossary/fluid-typography/","ogFileName":"fluid-typography"}}},"pageContext":{"slug":"/responsive-design-glossary/fluid-typography/"}},"staticQueryHashes":["4164364741","425175329"]}