├── .npmrc ├── postcss.config.json ├── .prettierignore ├── static ├── robots.txt ├── images │ ├── favicon-128.png │ ├── favicon-192.png │ ├── favicon-228.png │ ├── favicon-32.png │ ├── favicon-57.png │ ├── favicon-76.png │ ├── favicon-96.png │ └── thumbnail.png └── fonts │ ├── inter-variable-latin-roman.woff2 │ └── sourcecodepro-variable-latin-roman.woff2 ├── src ├── lib │ ├── styles │ │ ├── main.scss │ │ ├── _breakpoints.scss │ │ ├── _components.scss │ │ ├── _reset.scss │ │ ├── _utils.scss │ │ ├── _mixins.scss │ │ ├── _functions.scss │ │ ├── _global.scss │ │ ├── _variables.scss │ │ └── _fontFace.scss │ ├── data │ │ ├── socials.json │ │ ├── site.json │ │ └── typeScaleRatios.json │ ├── constants.ts │ ├── index.ts │ ├── types.ts │ ├── components │ │ ├── Link.svelte │ │ ├── FormError.svelte │ │ ├── App │ │ │ ├── Form │ │ │ │ ├── index.ts │ │ │ │ ├── GroupIncludeFallbacks.svelte │ │ │ │ ├── GroupRounding.svelte │ │ │ │ ├── GroupNamingConvention.svelte │ │ │ │ ├── GroupUseContainerWidth.svelte │ │ │ │ ├── GroupRems.svelte │ │ │ │ ├── GroupTypeScaleSteps.svelte │ │ │ │ ├── GroupMaximum.svelte │ │ │ │ └── GroupMinimum.svelte │ │ │ ├── App.svelte │ │ │ ├── Output.svelte │ │ │ └── Preview.svelte │ │ ├── Select.types.ts │ │ ├── Checkbox.svelte │ │ ├── CopyToClipboardButton.svelte │ │ ├── HeroBanner.svelte │ │ ├── Button.svelte │ │ ├── RangeInput.svelte │ │ ├── PageFooter.svelte │ │ ├── TypeScalePicker.svelte │ │ ├── Fieldset.svelte │ │ ├── Select.svelte │ │ ├── GoogleFontSelect.svelte │ │ ├── Input.svelte │ │ ├── Label.svelte │ │ ├── Info.svelte │ │ └── GitHubCorner.svelte │ ├── utils.ts │ └── schema │ │ ├── schema.utils.ts │ │ └── schema.ts ├── routes │ ├── +error.svelte │ ├── +page.svelte │ ├── +page.server.ts │ ├── calculate │ │ ├── +page.svelte │ │ └── +page.server.ts │ ├── sitemap.xml │ │ └── +server.ts │ └── +layout.svelte ├── app.d.ts ├── app.html └── index.test.ts ├── .editorconfig ├── .gitignore ├── .eslintignore ├── .prettierrc ├── .github └── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md ├── vite.config.ts ├── .gitattributes ├── tsconfig.json ├── .eslintrc.cjs ├── svelte.config.js ├── .stylelintrc.json ├── LICENSE ├── prebuild.js ├── package.json └── README.md /.npmrc: -------------------------------------------------------------------------------- 1 | engine-strict=true 2 | -------------------------------------------------------------------------------- /postcss.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": ["autoprefixer"] 3 | } 4 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # Ignore files for PNPM, NPM and YARN 2 | pnpm-lock.yaml 3 | package-lock.json 4 | yarn.lock 5 | -------------------------------------------------------------------------------- /static/robots.txt: -------------------------------------------------------------------------------- 1 | Sitemap: https://www.fluid-type-scale.com/sitemap.xml 2 | 3 | User-agent: * 4 | Allow: / 5 | Disallow: /calculate 6 | -------------------------------------------------------------------------------- /static/images/favicon-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AleksandrHovhannisyan/fluid-type-scale-calculator/HEAD/static/images/favicon-128.png -------------------------------------------------------------------------------- /static/images/favicon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AleksandrHovhannisyan/fluid-type-scale-calculator/HEAD/static/images/favicon-192.png -------------------------------------------------------------------------------- /static/images/favicon-228.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AleksandrHovhannisyan/fluid-type-scale-calculator/HEAD/static/images/favicon-228.png -------------------------------------------------------------------------------- /static/images/favicon-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AleksandrHovhannisyan/fluid-type-scale-calculator/HEAD/static/images/favicon-32.png -------------------------------------------------------------------------------- /static/images/favicon-57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AleksandrHovhannisyan/fluid-type-scale-calculator/HEAD/static/images/favicon-57.png -------------------------------------------------------------------------------- /static/images/favicon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AleksandrHovhannisyan/fluid-type-scale-calculator/HEAD/static/images/favicon-76.png -------------------------------------------------------------------------------- /static/images/favicon-96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AleksandrHovhannisyan/fluid-type-scale-calculator/HEAD/static/images/favicon-96.png -------------------------------------------------------------------------------- /static/images/thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AleksandrHovhannisyan/fluid-type-scale-calculator/HEAD/static/images/thumbnail.png -------------------------------------------------------------------------------- /src/lib/styles/main.scss: -------------------------------------------------------------------------------- 1 | @import './fontFace'; 2 | @import './reset'; 3 | @import './variables'; 4 | @import './utils'; 5 | @import './global'; 6 | @import './components'; 7 | -------------------------------------------------------------------------------- /static/fonts/inter-variable-latin-roman.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AleksandrHovhannisyan/fluid-type-scale-calculator/HEAD/static/fonts/inter-variable-latin-roman.woff2 -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true -------------------------------------------------------------------------------- /src/lib/styles/_breakpoints.scss: -------------------------------------------------------------------------------- 1 | $breakpoints: ( 2 | mobile-min: 360px, 3 | mobile: 400px, 4 | mobile-lg: 500px, 5 | tablet-sm: 640px, 6 | tablet: 768px, 7 | desktop: 1280px 8 | ); 9 | -------------------------------------------------------------------------------- /static/fonts/sourcecodepro-variable-latin-roman.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AleksandrHovhannisyan/fluid-type-scale-calculator/HEAD/static/fonts/sourcecodepro-variable-latin-roman.woff2 -------------------------------------------------------------------------------- /src/routes/+error.svelte: -------------------------------------------------------------------------------- 1 | 4 | 5 |
{description}
12 | {/if} 13 |9 | Design systems traditionally used static type scales, where the steps in the scale are not 10 | dependent on the viewport or container width. This means that developers have to write media 11 | queries to switch font sizes at mobile, tablet, and desktop breakpoints. But in practice, 12 | there are innumerable device widths and orientations, so there are always going to be edge 13 | cases where your font sizes are either too large or too small. 14 |
15 |
16 | By contrast, in a fluid type scale, each step has a minimum, maximum, and variable
17 | (viewport-dependent) font size. We can use CSS clamp and viewport width (vw) units to generate a set of font size variables that
20 | scale linearly. This means you no longer need to worry about fine-tuning your typography for
21 | discrete device widths: Just pick your minima and maxima, and the font sizes will scale
22 | fluidly in between.
23 |
clamp declaration.
37 | | Step | 98 |Min | 99 |Max | 100 |Rendered | 101 |Preview | 102 |
|---|---|---|---|---|
| {step} | 108 |{min} | 109 |{max} | 110 |{getFontSizeAtScreenWidth(previewWidth)} | 111 |119 | {previewText} 120 | | 121 |