├── src
├── global.d.ts
├── utils
│ ├── toRem.ts
│ ├── clampRange.ts
│ ├── toPx.ts
│ ├── setToPrecision.ts
│ ├── getShareUrl.ts
│ ├── parseQueryString.ts
│ ├── clickOutside.ts
│ └── getClampValue.ts
├── stores
│ └── currentSubtitle.ts
├── modules
│ ├── graph
│ │ ├── store.ts
│ │ ├── Graph.svelte
│ │ ├── utils.ts
│ │ ├── derived.ts
│ │ ├── customTooltip.ts
│ │ └── consts.ts
│ ├── tracker
│ │ ├── store.ts
│ │ ├── derived.ts
│ │ ├── utils.ts
│ │ ├── Sort.svelte
│ │ ├── Tracker.svelte
│ │ ├── AddValue.svelte
│ │ └── TableDataRow.svelte
│ ├── code
│ │ └── Section.svelte
│ ├── form
│ │ ├── store.ts
│ │ └── Form.svelte
│ └── tabs
│ │ └── Tabs.svelte
├── styles
│ ├── globals.pcss
│ ├── page.pcss
│ ├── typography.pcss
│ ├── scrollbar.pcss
│ ├── media.pcss
│ ├── reset-custom.pcss
│ ├── range.pcss
│ ├── variables.pcss
│ └── normalize.pcss
├── routes
│ ├── __layout.svelte
│ ├── index.svelte
│ ├── __error.svelte
│ └── about.svelte
├── components
│ ├── Stats.svelte
│ ├── ShareButton.svelte
│ ├── LineChart.svelte
│ ├── Legend.svelte
│ ├── InputWithRange.svelte
│ ├── Snippet.svelte
│ ├── Message.svelte
│ ├── Footer.svelte
│ └── Header.svelte
└── app.html
├── static
├── google6e1010a8fae63903.html
├── favicon.ico
├── robots.txt
├── images
│ ├── table.png
│ ├── editor.png
│ ├── snippet.png
│ ├── graph-decrease.png
│ └── graph-increase.png
├── favicon-16x16.png
├── favicon-32x32.png
├── mstile-150x150.png
├── apple-touch-icon.png
├── socials-default.jpg
├── android-chrome-192x192.png
├── android-chrome-512x512.png
├── webfonts
│ ├── fa-brands-400.ttf
│ ├── fa-solid-900.ttf
│ ├── fa-brands-400.woff2
│ ├── fa-regular-400.ttf
│ ├── fa-solid-900.woff2
│ └── fa-regular-400.woff2
├── g
│ └── images
│ │ ├── editor.5a8f99a.2bb048a65192a85028ae21e277cf3ba1.avif
│ │ ├── editor.5a8f99a.2bb048a65192a85028ae21e277cf3ba1.png
│ │ ├── editor.5a8f99a.2bb048a65192a85028ae21e277cf3ba1.webp
│ │ ├── editor.668f068.2bb048a65192a85028ae21e277cf3ba1.avif
│ │ ├── editor.668f068.2bb048a65192a85028ae21e277cf3ba1.png
│ │ ├── editor.668f068.2bb048a65192a85028ae21e277cf3ba1.webp
│ │ ├── editor.a1d08c9.2bb048a65192a85028ae21e277cf3ba1.avif
│ │ ├── editor.a1d08c9.2bb048a65192a85028ae21e277cf3ba1.png
│ │ ├── editor.a1d08c9.2bb048a65192a85028ae21e277cf3ba1.webp
│ │ ├── editor.d9015d2.2bb048a65192a85028ae21e277cf3ba1.avif
│ │ ├── editor.d9015d2.2bb048a65192a85028ae21e277cf3ba1.png
│ │ ├── editor.d9015d2.2bb048a65192a85028ae21e277cf3ba1.webp
│ │ ├── snippet.8509b1a.63b149124717d1f23fc75f409f86c762.png
│ │ ├── snippet.a1d08c9.63b149124717d1f23fc75f409f86c762.png
│ │ ├── table.48e1f11.c30557c7f994bcd0da96c3395c69ff71.avif
│ │ ├── table.48e1f11.c30557c7f994bcd0da96c3395c69ff71.png
│ │ ├── table.48e1f11.c30557c7f994bcd0da96c3395c69ff71.webp
│ │ ├── table.5a8f99a.c30557c7f994bcd0da96c3395c69ff71.avif
│ │ ├── table.5a8f99a.c30557c7f994bcd0da96c3395c69ff71.png
│ │ ├── table.5a8f99a.c30557c7f994bcd0da96c3395c69ff71.webp
│ │ ├── table.a1d08c9.c30557c7f994bcd0da96c3395c69ff71.avif
│ │ ├── table.a1d08c9.c30557c7f994bcd0da96c3395c69ff71.png
│ │ ├── table.a1d08c9.c30557c7f994bcd0da96c3395c69ff71.webp
│ │ ├── table.d9015d2.c30557c7f994bcd0da96c3395c69ff71.avif
│ │ ├── table.d9015d2.c30557c7f994bcd0da96c3395c69ff71.png
│ │ ├── table.d9015d2.c30557c7f994bcd0da96c3395c69ff71.webp
│ │ ├── snippet.8509b1a.63b149124717d1f23fc75f409f86c762.avif
│ │ ├── snippet.8509b1a.63b149124717d1f23fc75f409f86c762.webp
│ │ ├── snippet.a1d08c9.63b149124717d1f23fc75f409f86c762.avif
│ │ ├── snippet.a1d08c9.63b149124717d1f23fc75f409f86c762.webp
│ │ ├── graph-increase.5a8f99a.3e7989db31c3fb99059f7341810d53eb.png
│ │ ├── graph-increase.5eb441f.3e7989db31c3fb99059f7341810d53eb.png
│ │ ├── graph-increase.a1d08c9.3e7989db31c3fb99059f7341810d53eb.png
│ │ ├── graph-increase.d9015d2.3e7989db31c3fb99059f7341810d53eb.png
│ │ ├── graph-increase.5a8f99a.3e7989db31c3fb99059f7341810d53eb.avif
│ │ ├── graph-increase.5a8f99a.3e7989db31c3fb99059f7341810d53eb.webp
│ │ ├── graph-increase.5eb441f.3e7989db31c3fb99059f7341810d53eb.avif
│ │ ├── graph-increase.5eb441f.3e7989db31c3fb99059f7341810d53eb.webp
│ │ ├── graph-increase.a1d08c9.3e7989db31c3fb99059f7341810d53eb.avif
│ │ ├── graph-increase.a1d08c9.3e7989db31c3fb99059f7341810d53eb.webp
│ │ ├── graph-increase.d9015d2.3e7989db31c3fb99059f7341810d53eb.avif
│ │ └── graph-increase.d9015d2.3e7989db31c3fb99059f7341810d53eb.webp
├── browserconfig.xml
├── site.webmanifest
├── sitemap.xml
└── safari-pinned-tab.svg
├── .gitignore
├── .prettierrc
├── postcss.config.cjs
├── .eslintrc.cjs
├── README.md
├── tsconfig.json
├── LICENSE.md
├── svelte.config.js
└── package.json
/src/global.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/static/google6e1010a8fae63903.html:
--------------------------------------------------------------------------------
1 | google-site-verification: google6e1010a8fae63903.html
--------------------------------------------------------------------------------
/src/utils/toRem.ts:
--------------------------------------------------------------------------------
1 | export const toRem = ([value, root]: [number, number]) => value / root;
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /build
4 | /.svelte-kit
5 | /package
6 | .env
7 | .env.*
8 |
--------------------------------------------------------------------------------
/src/utils/clampRange.ts:
--------------------------------------------------------------------------------
1 | export const clampRange = (num, min, max) => Math.min(Math.max(num, min), max);
2 |
--------------------------------------------------------------------------------
/static/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/favicon.ico
--------------------------------------------------------------------------------
/static/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Allow: /
3 |
4 | Sitemap: https://modern-fluid-typography.vercel.app//sitemap.xml
--------------------------------------------------------------------------------
/src/utils/toPx.ts:
--------------------------------------------------------------------------------
1 | export const toPx = ([relativeSize, rootFontSize]: [number, number]) => relativeSize * rootFontSize;
2 |
--------------------------------------------------------------------------------
/static/images/table.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/images/table.png
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "useTabs": true,
3 | "singleQuote": true,
4 | "trailingComma": "none",
5 | "printWidth": 100
6 | }
7 |
--------------------------------------------------------------------------------
/src/stores/currentSubtitle.ts:
--------------------------------------------------------------------------------
1 | import { writable } from 'svelte/store';
2 |
3 | export const currentSubtitle = writable('');
4 |
--------------------------------------------------------------------------------
/static/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/favicon-16x16.png
--------------------------------------------------------------------------------
/static/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/favicon-32x32.png
--------------------------------------------------------------------------------
/static/images/editor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/images/editor.png
--------------------------------------------------------------------------------
/static/images/snippet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/images/snippet.png
--------------------------------------------------------------------------------
/static/mstile-150x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/mstile-150x150.png
--------------------------------------------------------------------------------
/static/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/apple-touch-icon.png
--------------------------------------------------------------------------------
/static/socials-default.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/socials-default.jpg
--------------------------------------------------------------------------------
/static/android-chrome-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/android-chrome-192x192.png
--------------------------------------------------------------------------------
/static/android-chrome-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/android-chrome-512x512.png
--------------------------------------------------------------------------------
/static/images/graph-decrease.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/images/graph-decrease.png
--------------------------------------------------------------------------------
/static/images/graph-increase.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/images/graph-increase.png
--------------------------------------------------------------------------------
/static/webfonts/fa-brands-400.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/webfonts/fa-brands-400.ttf
--------------------------------------------------------------------------------
/static/webfonts/fa-solid-900.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/webfonts/fa-solid-900.ttf
--------------------------------------------------------------------------------
/static/webfonts/fa-brands-400.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/webfonts/fa-brands-400.woff2
--------------------------------------------------------------------------------
/static/webfonts/fa-regular-400.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/webfonts/fa-regular-400.ttf
--------------------------------------------------------------------------------
/static/webfonts/fa-solid-900.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/webfonts/fa-solid-900.woff2
--------------------------------------------------------------------------------
/src/utils/setToPrecision.ts:
--------------------------------------------------------------------------------
1 | export const setToPrecision = (num, decimals) =>
2 | Math.round(num * Math.pow(10, decimals)) / Math.pow(10, decimals);
3 |
--------------------------------------------------------------------------------
/static/webfonts/fa-regular-400.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/webfonts/fa-regular-400.woff2
--------------------------------------------------------------------------------
/src/modules/graph/store.ts:
--------------------------------------------------------------------------------
1 | import { writable } from 'svelte/store';
2 |
3 | const minResolution = writable(300);
4 | const maxResolution = writable(1920);
5 |
6 | export { minResolution, maxResolution };
7 |
--------------------------------------------------------------------------------
/static/g/images/editor.5a8f99a.2bb048a65192a85028ae21e277cf3ba1.avif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/editor.5a8f99a.2bb048a65192a85028ae21e277cf3ba1.avif
--------------------------------------------------------------------------------
/static/g/images/editor.5a8f99a.2bb048a65192a85028ae21e277cf3ba1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/editor.5a8f99a.2bb048a65192a85028ae21e277cf3ba1.png
--------------------------------------------------------------------------------
/static/g/images/editor.5a8f99a.2bb048a65192a85028ae21e277cf3ba1.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/editor.5a8f99a.2bb048a65192a85028ae21e277cf3ba1.webp
--------------------------------------------------------------------------------
/static/g/images/editor.668f068.2bb048a65192a85028ae21e277cf3ba1.avif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/editor.668f068.2bb048a65192a85028ae21e277cf3ba1.avif
--------------------------------------------------------------------------------
/static/g/images/editor.668f068.2bb048a65192a85028ae21e277cf3ba1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/editor.668f068.2bb048a65192a85028ae21e277cf3ba1.png
--------------------------------------------------------------------------------
/static/g/images/editor.668f068.2bb048a65192a85028ae21e277cf3ba1.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/editor.668f068.2bb048a65192a85028ae21e277cf3ba1.webp
--------------------------------------------------------------------------------
/static/g/images/editor.a1d08c9.2bb048a65192a85028ae21e277cf3ba1.avif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/editor.a1d08c9.2bb048a65192a85028ae21e277cf3ba1.avif
--------------------------------------------------------------------------------
/static/g/images/editor.a1d08c9.2bb048a65192a85028ae21e277cf3ba1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/editor.a1d08c9.2bb048a65192a85028ae21e277cf3ba1.png
--------------------------------------------------------------------------------
/static/g/images/editor.a1d08c9.2bb048a65192a85028ae21e277cf3ba1.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/editor.a1d08c9.2bb048a65192a85028ae21e277cf3ba1.webp
--------------------------------------------------------------------------------
/static/g/images/editor.d9015d2.2bb048a65192a85028ae21e277cf3ba1.avif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/editor.d9015d2.2bb048a65192a85028ae21e277cf3ba1.avif
--------------------------------------------------------------------------------
/static/g/images/editor.d9015d2.2bb048a65192a85028ae21e277cf3ba1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/editor.d9015d2.2bb048a65192a85028ae21e277cf3ba1.png
--------------------------------------------------------------------------------
/static/g/images/editor.d9015d2.2bb048a65192a85028ae21e277cf3ba1.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/editor.d9015d2.2bb048a65192a85028ae21e277cf3ba1.webp
--------------------------------------------------------------------------------
/static/g/images/snippet.8509b1a.63b149124717d1f23fc75f409f86c762.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/snippet.8509b1a.63b149124717d1f23fc75f409f86c762.png
--------------------------------------------------------------------------------
/static/g/images/snippet.a1d08c9.63b149124717d1f23fc75f409f86c762.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/snippet.a1d08c9.63b149124717d1f23fc75f409f86c762.png
--------------------------------------------------------------------------------
/static/g/images/table.48e1f11.c30557c7f994bcd0da96c3395c69ff71.avif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/table.48e1f11.c30557c7f994bcd0da96c3395c69ff71.avif
--------------------------------------------------------------------------------
/static/g/images/table.48e1f11.c30557c7f994bcd0da96c3395c69ff71.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/table.48e1f11.c30557c7f994bcd0da96c3395c69ff71.png
--------------------------------------------------------------------------------
/static/g/images/table.48e1f11.c30557c7f994bcd0da96c3395c69ff71.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/table.48e1f11.c30557c7f994bcd0da96c3395c69ff71.webp
--------------------------------------------------------------------------------
/static/g/images/table.5a8f99a.c30557c7f994bcd0da96c3395c69ff71.avif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/table.5a8f99a.c30557c7f994bcd0da96c3395c69ff71.avif
--------------------------------------------------------------------------------
/static/g/images/table.5a8f99a.c30557c7f994bcd0da96c3395c69ff71.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/table.5a8f99a.c30557c7f994bcd0da96c3395c69ff71.png
--------------------------------------------------------------------------------
/static/g/images/table.5a8f99a.c30557c7f994bcd0da96c3395c69ff71.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/table.5a8f99a.c30557c7f994bcd0da96c3395c69ff71.webp
--------------------------------------------------------------------------------
/static/g/images/table.a1d08c9.c30557c7f994bcd0da96c3395c69ff71.avif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/table.a1d08c9.c30557c7f994bcd0da96c3395c69ff71.avif
--------------------------------------------------------------------------------
/static/g/images/table.a1d08c9.c30557c7f994bcd0da96c3395c69ff71.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/table.a1d08c9.c30557c7f994bcd0da96c3395c69ff71.png
--------------------------------------------------------------------------------
/static/g/images/table.a1d08c9.c30557c7f994bcd0da96c3395c69ff71.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/table.a1d08c9.c30557c7f994bcd0da96c3395c69ff71.webp
--------------------------------------------------------------------------------
/static/g/images/table.d9015d2.c30557c7f994bcd0da96c3395c69ff71.avif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/table.d9015d2.c30557c7f994bcd0da96c3395c69ff71.avif
--------------------------------------------------------------------------------
/static/g/images/table.d9015d2.c30557c7f994bcd0da96c3395c69ff71.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/table.d9015d2.c30557c7f994bcd0da96c3395c69ff71.png
--------------------------------------------------------------------------------
/static/g/images/table.d9015d2.c30557c7f994bcd0da96c3395c69ff71.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/table.d9015d2.c30557c7f994bcd0da96c3395c69ff71.webp
--------------------------------------------------------------------------------
/static/g/images/snippet.8509b1a.63b149124717d1f23fc75f409f86c762.avif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/snippet.8509b1a.63b149124717d1f23fc75f409f86c762.avif
--------------------------------------------------------------------------------
/static/g/images/snippet.8509b1a.63b149124717d1f23fc75f409f86c762.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/snippet.8509b1a.63b149124717d1f23fc75f409f86c762.webp
--------------------------------------------------------------------------------
/static/g/images/snippet.a1d08c9.63b149124717d1f23fc75f409f86c762.avif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/snippet.a1d08c9.63b149124717d1f23fc75f409f86c762.avif
--------------------------------------------------------------------------------
/static/g/images/snippet.a1d08c9.63b149124717d1f23fc75f409f86c762.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/snippet.a1d08c9.63b149124717d1f23fc75f409f86c762.webp
--------------------------------------------------------------------------------
/static/g/images/graph-increase.5a8f99a.3e7989db31c3fb99059f7341810d53eb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/graph-increase.5a8f99a.3e7989db31c3fb99059f7341810d53eb.png
--------------------------------------------------------------------------------
/static/g/images/graph-increase.5eb441f.3e7989db31c3fb99059f7341810d53eb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/graph-increase.5eb441f.3e7989db31c3fb99059f7341810d53eb.png
--------------------------------------------------------------------------------
/static/g/images/graph-increase.a1d08c9.3e7989db31c3fb99059f7341810d53eb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/graph-increase.a1d08c9.3e7989db31c3fb99059f7341810d53eb.png
--------------------------------------------------------------------------------
/static/g/images/graph-increase.d9015d2.3e7989db31c3fb99059f7341810d53eb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/graph-increase.d9015d2.3e7989db31c3fb99059f7341810d53eb.png
--------------------------------------------------------------------------------
/static/g/images/graph-increase.5a8f99a.3e7989db31c3fb99059f7341810d53eb.avif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/graph-increase.5a8f99a.3e7989db31c3fb99059f7341810d53eb.avif
--------------------------------------------------------------------------------
/static/g/images/graph-increase.5a8f99a.3e7989db31c3fb99059f7341810d53eb.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/graph-increase.5a8f99a.3e7989db31c3fb99059f7341810d53eb.webp
--------------------------------------------------------------------------------
/static/g/images/graph-increase.5eb441f.3e7989db31c3fb99059f7341810d53eb.avif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/graph-increase.5eb441f.3e7989db31c3fb99059f7341810d53eb.avif
--------------------------------------------------------------------------------
/static/g/images/graph-increase.5eb441f.3e7989db31c3fb99059f7341810d53eb.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/graph-increase.5eb441f.3e7989db31c3fb99059f7341810d53eb.webp
--------------------------------------------------------------------------------
/static/g/images/graph-increase.a1d08c9.3e7989db31c3fb99059f7341810d53eb.avif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/graph-increase.a1d08c9.3e7989db31c3fb99059f7341810d53eb.avif
--------------------------------------------------------------------------------
/static/g/images/graph-increase.a1d08c9.3e7989db31c3fb99059f7341810d53eb.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/graph-increase.a1d08c9.3e7989db31c3fb99059f7341810d53eb.webp
--------------------------------------------------------------------------------
/static/g/images/graph-increase.d9015d2.3e7989db31c3fb99059f7341810d53eb.avif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/graph-increase.d9015d2.3e7989db31c3fb99059f7341810d53eb.avif
--------------------------------------------------------------------------------
/static/g/images/graph-increase.d9015d2.3e7989db31c3fb99059f7341810d53eb.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codeAdrian/modern-fluid-typography-editor/HEAD/static/g/images/graph-increase.d9015d2.3e7989db31c3fb99059f7341810d53eb.webp
--------------------------------------------------------------------------------
/src/styles/globals.pcss:
--------------------------------------------------------------------------------
1 | @import './reset-custom.pcss';
2 |
3 | @import './variables.pcss';
4 | @import './icons.pcss';
5 |
6 | @import './typography.pcss';
7 |
8 | @import './scrollbar.pcss';
9 | @import './range.pcss';
10 |
11 | @import './page.pcss';
12 |
--------------------------------------------------------------------------------
/src/modules/graph/Graph.svelte:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/styles/page.pcss:
--------------------------------------------------------------------------------
1 | html {
2 | min-height: 100%;
3 | }
4 |
5 | body {
6 | background-color: var(--color-gray-dark);
7 | color: var(--color-gray-light);
8 | height: 100%;
9 | display: flex;
10 | flex-direction: column;
11 | }
12 |
13 | main {
14 | flex-grow: 1;
15 | }
16 |
--------------------------------------------------------------------------------
/src/modules/graph/utils.ts:
--------------------------------------------------------------------------------
1 | export const getScalesConfig = (y: { min: number; max: number; grid?: any }) => {
2 | y.min = x.min + 10;
3 | y.max = x.max + 10;
4 | y.grid = { display: false };
5 |
6 | return {
7 | scales: {
8 | x: { min: 200, max: 2000 },
9 | y
10 | }
11 | };
12 | };
13 |
--------------------------------------------------------------------------------
/src/routes/__layout.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
15 |
--------------------------------------------------------------------------------
/static/browserconfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | #37314b
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/utils/getShareUrl.ts:
--------------------------------------------------------------------------------
1 | export const getShareUrl = ([rootFontSize, min, fluid, relative, max]: [
2 | number,
3 | number,
4 | number,
5 | number,
6 | number
7 | ]) =>
8 | `https://modern-fluid-typography.vercel.app?rootFontSize=${rootFontSize}&minSize=${min}&fluidSize=${fluid}&relativeSize=${relative}&maxSize=${max}`;
9 |
--------------------------------------------------------------------------------
/src/modules/tracker/store.ts:
--------------------------------------------------------------------------------
1 | import { writable } from 'svelte/store';
2 |
3 | export const trackers = writable([
4 | { id: 10, width: 300 },
5 | { id: 11, width: 360 },
6 | { id: 12, width: 480 },
7 | { id: 13, width: 568 },
8 | { id: 14, width: 768 },
9 | { id: 15, width: 920 },
10 | { id: 16, width: 1024 },
11 | { id: 17, width: 1280 },
12 | { id: 18, width: 1440 }
13 | ]);
14 |
--------------------------------------------------------------------------------
/src/modules/tracker/derived.ts:
--------------------------------------------------------------------------------
1 | import { derived } from 'svelte/store';
2 | import { trackers } from './store';
3 |
4 | export const trackersAsc = derived([trackers], ([$trackers]) => {
5 | const sorted = $trackers.sort((a, b) => a.width - b.width);
6 | return sorted;
7 | });
8 |
9 | export const trackersDesc = derived([trackersAsc], ([$trackersAsc]) => {
10 | return [...$trackersAsc].reverse();
11 | });
12 |
--------------------------------------------------------------------------------
/src/styles/typography.pcss:
--------------------------------------------------------------------------------
1 | body {
2 | font-family: var(--font-family-secondary);
3 | font-weight: var(--font-weight-regular);
4 | font-size: var(--font-size-base);
5 | line-height: var(--typography-lineHeight);
6 | }
7 |
8 | h1,
9 | h2,
10 | h3 {
11 | font-family: var(--font-family-primary);
12 | font-weight: var(--font-weight-regular);
13 | color: var(--color-primary);
14 | line-height: 1.25;
15 | }
16 |
--------------------------------------------------------------------------------
/src/utils/parseQueryString.ts:
--------------------------------------------------------------------------------
1 | import { browser } from '$app/env';
2 |
3 | export const parseQueryString = (item: string) => {
4 | if (!browser) {
5 | return;
6 | }
7 |
8 | const searchParams = new URLSearchParams(window.location.search);
9 |
10 | const result = parseInt(searchParams.get(item));
11 |
12 | if (isNaN(result)) {
13 | return;
14 | }
15 |
16 | return searchParams.get(item);
17 | };
18 |
--------------------------------------------------------------------------------
/postcss.config.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: [
3 | require('postcss-preset-env')({
4 | stage: 3,
5 | features: {
6 | 'nesting-rules': true,
7 | 'custom-media-queries': {
8 | importFrom: './src/styles/media.pcss',
9 | },
10 | },
11 | }),
12 | require('cssnano'),
13 | ],
14 | };
15 |
--------------------------------------------------------------------------------
/src/styles/scrollbar.pcss:
--------------------------------------------------------------------------------
1 |
2 | ::-webkit-scrollbar {
3 | width: var(--spacing-n1);
4 | }
5 |
6 |
7 | ::-webkit-scrollbar-track {
8 | background: var(--color-gray-medium-faded);
9 | }
10 |
11 |
12 | ::-webkit-scrollbar-thumb {
13 | background: var(--color-gray-medium);
14 | border-radius: var(--spacing-1);
15 | }
16 |
17 |
18 | ::-webkit-scrollbar-thumb:hover {
19 | background: var(--color-gray-medium);
20 | }
--------------------------------------------------------------------------------
/src/utils/clickOutside.ts:
--------------------------------------------------------------------------------
1 | export const clickOutside = (node) => {
2 | const handleClick = (event) => {
3 | if (node && !node.contains(event.target) && !event.defaultPrevented) {
4 | node.dispatchEvent(new CustomEvent('click_outside', node));
5 | }
6 | };
7 |
8 | document.addEventListener('click', handleClick, true);
9 |
10 | return {
11 | destroy() {
12 | document.removeEventListener('click', handleClick, true);
13 | }
14 | };
15 | };
16 |
--------------------------------------------------------------------------------
/src/modules/tracker/utils.ts:
--------------------------------------------------------------------------------
1 | import { clampRange } from 'src/utils/clampRange';
2 |
3 | export const generateUniqueId = () => Math.floor(Math.random() * Date.now());
4 |
5 | export const calculateSizeValue = (screenSize, fluidSize, relativeSizePx, minValue, maxValue) => {
6 | if (minValue >= maxValue) return minValue;
7 |
8 | return clampRange(
9 | Math.round((fluidSize / 100) * screenSize + relativeSizePx),
10 | minValue,
11 | maxValue
12 | );
13 | };
14 |
--------------------------------------------------------------------------------
/static/site.webmanifest:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Modern Fluid Typography Editor",
3 | "short_name": "Modern Fluid Typography Editor",
4 | "icons": [
5 | {
6 | "src": "/android-chrome-192x192.png",
7 | "sizes": "192x192",
8 | "type": "image/png"
9 | },
10 | {
11 | "src": "/android-chrome-512x512.png",
12 | "sizes": "512x512",
13 | "type": "image/png"
14 | }
15 | ],
16 | "theme_color": "#37314b",
17 | "background_color": "#37314b",
18 | "display": "standalone"
19 | }
20 |
--------------------------------------------------------------------------------
/src/utils/getClampValue.ts:
--------------------------------------------------------------------------------
1 | import { setToPrecision } from './setToPrecision';
2 |
3 | const getDynamicValue = (fluid: number, relative: number) => {
4 | if (relative === 0 || !relative) {
5 | return `${fluid}vw`;
6 | }
7 |
8 | return relative < 0 ? `${fluid}vw - ${-1 * relative}rem` : `${fluid}vw + ${relative}rem`;
9 | };
10 |
11 | export const getClampValue = ([min, fluid, relative, max]: [number, number, number, number]) =>
12 | `clamp(${setToPrecision(min, 3)}rem, ${getDynamicValue(fluid, relative)}, ${setToPrecision(
13 | max,
14 | 3
15 | )}rem);`;
16 |
--------------------------------------------------------------------------------
/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | parser: '@typescript-eslint/parser',
4 | extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
5 | plugins: ['svelte3', '@typescript-eslint'],
6 | ignorePatterns: ['*.cjs'],
7 | overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
8 | settings: {
9 | 'svelte3/typescript': () => require('typescript')
10 | },
11 | parserOptions: {
12 | sourceType: 'module',
13 | ecmaVersion: 2019
14 | },
15 | env: {
16 | browser: true,
17 | es2017: true,
18 | node: true
19 | }
20 | };
21 |
--------------------------------------------------------------------------------
/src/modules/code/Section.svelte:
--------------------------------------------------------------------------------
1 |
5 |
6 | {#if $minSize >= $maxSize}
7 |
8 | Fluid snippet doesn't have any effect. Minimum size is larger than maximum size.
9 |
10 | {/if}
11 |
12 | {#if $relativeSize > -1 && $relativeSize < 1}
13 | It's recommended to set "Relative Size" to a value -1 or less or 1 and greater to support user
15 | font size preferences.
17 | {/if}
18 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Modern Fluid Typography Editor
2 |
3 |
element in src/app.html
31 | target: '#svelte',
32 | vite: {
33 | resolve: {
34 | alias: {
35 | src: path.resolve('./src'),
36 | assets: path.resolve('./src/assets'),
37 | components: path.resolve('./src/components'),
38 | modules: path.resolve('./src/modules'),
39 | models: path.resolve('./src/models'),
40 | utils: path.resolve('./src/utils')
41 | }
42 | }
43 | }
44 | }
45 | };
46 |
47 | export default config;
48 |
--------------------------------------------------------------------------------
/src/modules/form/store.ts:
--------------------------------------------------------------------------------
1 | import { getClampValue } from 'src/utils/getClampValue';
2 | import { getShareUrl } from 'src/utils/getShareUrl';
3 | import { parseQueryString } from 'src/utils/parseQueryString';
4 | import { toPx } from 'src/utils/toPx';
5 | import { toRem } from 'src/utils/toRem';
6 | import { derived, writable } from 'svelte/store';
7 |
8 | const rootFontSize = writable(parseQueryString('rootFontSize') || 16);
9 | const minSize = writable(parseQueryString('minSize') || 24);
10 | const maxSize = writable(parseQueryString('maxSize') || 36);
11 | const fluidSize = writable(parseQueryString('fluidSize') || 2);
12 | const relativeSize = writable(parseQueryString('relativeSize') || 1);
13 |
14 | const minSizeRem = derived([minSize, rootFontSize], toRem);
15 | const maxSizeRem = derived([maxSize, rootFontSize], toRem);
16 | const relativeSizePx = derived([relativeSize, rootFontSize], toPx);
17 |
18 | const clampValue = derived([minSizeRem, fluidSize, relativeSize, maxSizeRem], getClampValue);
19 |
20 | const shareUrl = derived([rootFontSize, minSize, fluidSize, relativeSize, maxSize], getShareUrl);
21 |
22 | export {
23 | rootFontSize,
24 | minSize,
25 | maxSize,
26 | fluidSize,
27 | relativeSize,
28 | minSizeRem,
29 | maxSizeRem,
30 | clampValue,
31 | relativeSizePx,
32 | shareUrl
33 | };
34 |
--------------------------------------------------------------------------------
/src/components/ShareButton.svelte:
--------------------------------------------------------------------------------
1 |
14 |
15 |
16 |
17 | {#if hasCopied}
18 |
19 | Link copied
20 | {:else}
21 |
22 | Copy link
23 | {/if}
24 |
25 |
26 |
27 |
53 |
--------------------------------------------------------------------------------
/src/components/LineChart.svelte:
--------------------------------------------------------------------------------
1 |
33 |
34 |
35 |
36 |
37 |
38 |
55 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "modern-fluid-typography-editor",
3 | "version": "0.0.1",
4 | "scripts": {
5 | "dev": "svelte-kit dev",
6 | "build": "svelte-kit build",
7 | "package": "svelte-kit package",
8 | "preview": "svelte-kit preview",
9 | "check": "svelte-check --tsconfig ./tsconfig.json",
10 | "check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
11 | "lint": "prettier --ignore-path .gitignore --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .",
12 | "format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. ."
13 | },
14 | "devDependencies": {
15 | "@sveltejs/adapter-auto": "next",
16 | "@sveltejs/kit": "next",
17 | "@typescript-eslint/eslint-plugin": "^4.31.1",
18 | "@typescript-eslint/parser": "^4.31.1",
19 | "eslint": "^7.32.0",
20 | "eslint-config-prettier": "^8.3.0",
21 | "eslint-plugin-svelte3": "^3.2.1",
22 | "postcss": "^8.4.4",
23 | "postcss-custom-media": "^8.0.0",
24 | "postcss-load-config": "^3.1.0",
25 | "postcss-preset-env": "^7.0.1",
26 | "prettier": "^2.4.1",
27 | "prettier-plugin-svelte": "^2.4.0",
28 | "svelte": "^3.44.0",
29 | "svelte-check": "^2.2.6",
30 | "svelte-clipboard": "^1.0.0",
31 | "svelte-preprocess": "^4.9.4",
32 | "svimg": "^1.1.0",
33 | "tslib": "^2.3.1",
34 | "typescript": "^4.4.3",
35 | "@sveltejs/adapter-vercel": "next",
36 | "cssnano": "^5.0.12"
37 | },
38 | "type": "module",
39 | "dependencies": {
40 | "@floating-ui/dom": "^0.1.4",
41 | "chart.js": "^3.4.0",
42 | "chartjs-plugin-crosshair": "^1.2.0"
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/components/Legend.svelte:
--------------------------------------------------------------------------------
1 |
2 | Legend
3 |
4 | Min value
5 | Within min and max range
6 | Max value
7 |
8 |
9 |
10 |
64 |
--------------------------------------------------------------------------------
/src/modules/tracker/Tracker.svelte:
--------------------------------------------------------------------------------
1 |
14 |
15 |
9} class="tracker-wrapper">
16 |
17 |
18 |
19 |
20 |
21 | Screen width
22 |
23 | Fluid size value
24 |
25 |
26 |
27 |
28 | {#key `${isAsc ? 'asc' : 'desc'}`}
29 | {#each items as item}
30 |
31 | {/each}
32 | {/key}
33 |
34 |
35 |
36 |
37 |
75 |
--------------------------------------------------------------------------------
/static/safari-pinned-tab.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
7 |
8 | Created by potrace 1.14, written by Peter Selinger 2001-2017
9 |
10 |
12 |
25 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/src/components/InputWithRange.svelte:
--------------------------------------------------------------------------------
1 |
7 |
8 |
{label}
9 |
10 |
11 |
12 | {unit}
13 |
14 |
22 |
23 |
68 |
--------------------------------------------------------------------------------
/src/routes/index.svelte:
--------------------------------------------------------------------------------
1 |
14 |
15 |
16 |
19 |
20 |
21 |
22 | {#if activeTab === 0}
23 |
29 |
30 | {:else}
31 |
32 |
33 |
34 |
35 |
36 | {/if}
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
76 |
--------------------------------------------------------------------------------
/src/modules/graph/derived.ts:
--------------------------------------------------------------------------------
1 | import { derived } from 'svelte/store';
2 | import { fluidSize, maxSize, minSize, relativeSizePx } from 'src/modules/form/store';
3 | import { clampRange } from 'src/utils/clampRange';
4 |
5 | export const graphChangeStart = derived(
6 | [minSize, maxSize, fluidSize, relativeSizePx],
7 | ([$minSize, $maxSize, $fluidSize, $relativeSizePx]) => {
8 | if ($minSize >= $maxSize) {
9 | return { x: 0, y: $minSize };
10 | }
11 | return { x: Math.round((100 * ($minSize - $relativeSizePx)) / $fluidSize), y: $minSize };
12 | }
13 | );
14 |
15 | export const graphChangeEnd = derived(
16 | [minSize, maxSize, fluidSize, relativeSizePx],
17 | ([$minSize, $maxSize, $fluidSize, $relativeSizePx]) => {
18 | if ($minSize >= $maxSize) {
19 | return { x: 1900, y: $minSize };
20 | }
21 | return { x: Math.round((100 * ($maxSize - $relativeSizePx)) / $fluidSize), y: $maxSize };
22 | }
23 | );
24 |
25 | export const graphStart = derived(
26 | [minSize, maxSize, fluidSize, relativeSizePx, graphChangeStart],
27 | ([$minSize, $maxSize, $fluidSize, $relativeSizePx, $graphChangeStart]) => {
28 | if ($minSize >= $maxSize) {
29 | return { x: 100, y: $minSize };
30 | }
31 |
32 | const x = Math.min($graphChangeStart.x - 100, 100);
33 |
34 | return {
35 | x,
36 | y: clampRange(($fluidSize / 100) * x + $relativeSizePx, $minSize, $maxSize)
37 | };
38 | }
39 | );
40 |
41 | export const graphEnd = derived(
42 | [minSize, maxSize, fluidSize, relativeSizePx, graphChangeEnd],
43 | ([$minSize, $maxSize, $fluidSize, $relativeSizePx, $graphChangeEnd]) => {
44 | if ($minSize >= $maxSize) {
45 | return { x: 1400, y: $minSize };
46 | }
47 |
48 | const x = Math.max($graphChangeEnd.x + 100, 1400);
49 |
50 | return {
51 | x,
52 | y: clampRange(($fluidSize / 100) * x + $relativeSizePx, $minSize, $maxSize)
53 | };
54 | }
55 | );
56 |
57 | export const graphPoints = derived(
58 | [graphStart, graphChangeStart, graphChangeEnd, graphEnd],
59 | ([$graphStart, $graphChangeStart, $graphChangeEnd, $graphEnd]) => {
60 | return [$graphStart, $graphChangeStart, $graphChangeEnd, $graphEnd].sort((a, b) => a.x - b.x);
61 | }
62 | );
63 |
--------------------------------------------------------------------------------
/src/styles/range.pcss:
--------------------------------------------------------------------------------
1 | input[type=range] {
2 | background: transparent;
3 | -webkit-appearance: none;
4 | width: 100%;
5 | margin-top: calc(var(--spacing-1) - var(--spacing-n4));
6 | }
7 | input[type=range]:focus {
8 | outline: none;
9 | }
10 | input[type=range]::-webkit-slider-runnable-track {
11 | width: 100%;
12 | height: 4px;
13 | cursor: pointer;;
14 | background: var(--color-gray-medium);
15 | border: 0.2px solid var(--color-gray-medium);
16 | }
17 | input[type=range]::-webkit-slider-thumb {
18 | border: 1px solid var(--color-gray-light);
19 | height: 16px;
20 | width: 16px;
21 | background: var(--color-gray-light);
22 | cursor: pointer;
23 | -webkit-appearance: none;
24 | margin-top: -8px;
25 | border-radius: 16px;
26 | }
27 | input[type=range]:focus::-webkit-slider-runnable-track {
28 | background: var(--color-gray-light);
29 | }
30 | input[type=range]::-moz-range-track {
31 | width: 100%;
32 | height: 4px;
33 | cursor: pointer;
34 | background: var(--color-gray-medium);
35 | border: 0.2px solid var(--color-gray-medium);
36 | }
37 | input[type=range]::-moz-range-thumb {
38 | border: 1px solid var(--color-gray-light);
39 | height: 16px;
40 | width: 16px;
41 | background: var(--color-gray-light);
42 | cursor: pointer;
43 | }
44 | input[type=range]::-ms-track {
45 | width: 100%;
46 | height: 4px;
47 | cursor: pointer;
48 | background: transparent;
49 | border-color: transparent;
50 | border-width: 16px 0;
51 | color: transparent;
52 | }
53 | input[type=range]::-ms-fill-lower {
54 | background: var(--color-gray-light);
55 | border: 0.2px solid var(--color-gray-light);
56 | }
57 | input[type=range]::-ms-fill-upper {
58 | background: var(--color-gray-light);
59 | border: 0.2px solid var(--color-gray-light);
60 | }
61 | input[type=range]::-ms-thumb {
62 | border: 1px solid var(--color-gray-light);
63 | height: 16px;
64 | width: 16px;
65 | background: var(--color-gray-light);
66 | cursor: pointer;
67 | }
68 | input[type=range]:focus::-ms-fill-lower {
69 | background: var(--color-gray-light);
70 | }
71 | input[type=range]:focus::-ms-fill-upper {
72 | background: var(--color-gray-light);
73 | }
--------------------------------------------------------------------------------
/src/modules/graph/customTooltip.ts:
--------------------------------------------------------------------------------
1 | export const getOrCreateTooltip = (chart) => {
2 | let tooltipEl = chart.canvas.parentNode.querySelector('#chart-tooltip');
3 |
4 | if (!tooltipEl) {
5 | tooltipEl = document.createElement('div');
6 | tooltipEl.id = 'chart-tooltip';
7 | tooltipEl.style.pointerEvents = 'none';
8 | tooltipEl.style.position = 'absolute';
9 | tooltipEl.style.top = '0px';
10 | tooltipEl.style.border = '2px solid var(--color-secondary-tint)';
11 | tooltipEl.style.color = 'var(--color-secondary)';
12 | tooltipEl.style.background = 'var(--color-secondary-faded)';
13 | tooltipEl.style.fontWeight = 'var(--font-weight-bold)';
14 | tooltipEl.style.fontSize = 'var(--font-size-small)';
15 | tooltipEl.style.padding = 'var(--spacing-n2)';
16 | tooltipEl.style.lineHeight = '1';
17 | tooltipEl.style.textAlign = 'center';
18 |
19 | const span = document.createElement('span');
20 | tooltipEl.appendChild(span);
21 | chart.canvas.parentNode.appendChild(tooltipEl);
22 | }
23 |
24 | return tooltipEl;
25 | };
26 |
27 | export const externalTooltipHandler = (context) => {
28 | const { chart, tooltip } = context;
29 | const tooltipEl = getOrCreateTooltip(chart, tooltip);
30 |
31 | tooltipEl.style.opacity = tooltip.opacity === 0 ? 0 : 1;
32 |
33 | if (tooltip.body) {
34 | const titleLines = tooltip.title || [];
35 | let text;
36 |
37 | titleLines.forEach((title) => {
38 | text = document.createTextNode(title);
39 | });
40 |
41 | const tableRoot = tooltipEl.querySelector('span');
42 |
43 | while (tableRoot.firstChild) {
44 | tableRoot.firstChild.remove();
45 | }
46 |
47 | tableRoot.appendChild(text);
48 | }
49 |
50 | const { offsetLeft: positionX, offsetTop: positionY } = chart.canvas;
51 |
52 | const isLeft = tooltip.caretX < chart.width / 2;
53 |
54 | if (isLeft) {
55 | tooltipEl.style.transform = 'translate3d(-1px,calc(-50% + 3px),0)';
56 | tooltipEl.style.borderRadius = '4px 4px 4px 0';
57 | } else {
58 | tooltipEl.style.transform = 'translate3d(calc(-100% + 1px),calc(-50% + 3px),0)';
59 | tooltipEl.style.borderRadius = '4px 4px 0 4px';
60 | }
61 |
62 | tooltipEl.style.top = '0';
63 |
64 | tooltipEl.style.left = positionX + tooltip.caretX + 'px';
65 | tooltipEl.style.minWidth = '20ch';
66 | tooltipEl.style.top = positionY + 'px';
67 | };
68 |
--------------------------------------------------------------------------------
/src/modules/tabs/Tabs.svelte:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | {#each tabs as label, index}
15 | {
19 | activeTab = index;
20 | }}>{label}
22 | {/each}
23 |
24 |
25 |
26 |
27 |
28 |
97 |
--------------------------------------------------------------------------------
/src/components/Snippet.svelte:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
25 |
26 |
27 | {text}
28 |
29 |
30 |
31 |
32 |
103 |
--------------------------------------------------------------------------------
/src/modules/graph/consts.ts:
--------------------------------------------------------------------------------
1 | import type { ChartConfiguration } from 'chart.js';
2 | import { externalTooltipHandler } from './customTooltip';
3 |
4 | export const CHART_OPTIONS: ChartConfiguration<'line'> = {
5 | type: 'scatter',
6 | data: {
7 | datasets: [
8 | {
9 | borderColor: 'hsl(169, 82%, 69%)',
10 | tension: 0,
11 | showLine: true,
12 | lineTension: 0,
13 | interpolate: true,
14 | pointRadius: 0,
15 | borderWidth: 4,
16 | borderJoinStyle: 'round',
17 | fill: true
18 | }
19 | ]
20 | },
21 | options: {
22 | animation: false,
23 | responsive: true,
24 | plugins: {
25 | legend: {
26 | display: false
27 | },
28 | crosshair: {
29 | line: {
30 | color: 'hsl(182, 29%, 51%)',
31 | width: 2
32 | },
33 | zoom: { enabled: false },
34 | sync: { enabled: false }
35 | },
36 | tooltip: {
37 | enabled: false,
38 | mode: 'interpolate',
39 | intersect: false,
40 | yAlign: 'bottom',
41 | external: externalTooltipHandler,
42 | callbacks: {
43 | title: function (a) {
44 | const { x, y } = a[0].element;
45 | return `${Math.round(y)}px at ${Math.round(x)}px`;
46 | },
47 | label: () => null
48 | }
49 | }
50 | },
51 | scales: {
52 | x: {
53 | min: 300,
54 | suggestedMax: 1024,
55 | type: 'linear',
56 | title: {
57 | text: 'Viewport width (pixels)',
58 | display: true,
59 | color: 'hsl(215, 22%, 85%)',
60 | font: { size: 16, family: 'Ubuntu' }
61 | },
62 | grid: {
63 | drawTicks: false,
64 | lineWidth: 2,
65 | borderWidth: 2,
66 | color: 'hsla(182, 29%, 51%, 0.25)'
67 | },
68 |
69 | ticks: {
70 | stepSize: 1,
71 | count: 12,
72 | precision: 0,
73 | padding: 10,
74 | color: (c) =>
75 | c['tick']['value'] <= 1400 ? 'hsla(215, 22%, 85%, 0.8)' : 'hsla(215, 22%, 85%, 0.5)',
76 | font: { size: 14 }
77 | }
78 | },
79 | y: {
80 | min: 0,
81 | suggestedMin: 16,
82 | suggestedMax: 48,
83 | title: {
84 | text: 'Fluid size (pixels)',
85 | display: true,
86 | color: 'hsl(215, 22%, 85%)',
87 | font: { size: 16, family: 'Ubuntu' },
88 | padding: 8
89 | },
90 | grid: {
91 | drawTicks: false,
92 | lineWidth: 2,
93 | borderWidth: 2,
94 | color: 'hsla(182, 29%, 51%, 0.25)'
95 | },
96 | ticks: {
97 | padding: 8,
98 | font: { size: 14 },
99 | color: 'hsla(215, 22%, 85%, 0.6)',
100 | callback: function (value, index) {
101 | return index === 0 ? '' : value;
102 | }
103 | }
104 | }
105 | }
106 | }
107 | };
108 |
--------------------------------------------------------------------------------
/src/components/Message.svelte:
--------------------------------------------------------------------------------
1 |
25 |
26 |
46 |
47 |
102 |
--------------------------------------------------------------------------------
/src/modules/tracker/AddValue.svelte:
--------------------------------------------------------------------------------
1 |
25 |
26 |
27 |
28 | Add screen width to track
29 |
30 |
31 |
49 |
50 |
51 |
104 |
--------------------------------------------------------------------------------
/src/routes/__error.svelte:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
106 |
--------------------------------------------------------------------------------
/src/app.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
Modern fluid typography editor
8 |
9 |
13 |
14 |
15 |
16 |
17 |
21 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
36 |
40 |
41 |
42 |
43 |
44 |
45 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
65 | %svelte.head%
66 |
67 |
68 | %svelte.body%
69 |
70 |
71 |
--------------------------------------------------------------------------------
/src/modules/form/Form.svelte:
--------------------------------------------------------------------------------
1 |
7 |
8 |
68 |
69 |
109 |
--------------------------------------------------------------------------------
/src/styles/variables.pcss:
--------------------------------------------------------------------------------
1 | :root {
2 | --color-primary: hsl(308, 82%, 55%);
3 | --color-primary-tint: hsl(308, 82%, 40%);
4 | --color-primary-faded: hsl(308, 82%, 44%, 0.1);
5 |
6 | --color-secondary: hsl(169, 82%, 69%);
7 | --color-secondary-tint: hsl(182, 29%, 51%);
8 | --color-secondary-faded: hsla(182, 29%, 51%, 0.1);
9 |
10 | --color-tertiary: hsl(60, 82%, 47%);
11 | --color-tertiary-tint: hsl(60, 80%, 29%);
12 | --color-tertiary-faded: hsl(60, 80%, 29%, 0.15);
13 |
14 | --color-gray-dark: hsl(254, 21%, 20%);
15 | --color-gray-medium: hsl(246, 11%, 32%);
16 | --color-gray-light: hsl(215, 22%, 85%);
17 | --color-gray-lightest: hsl(215, 22%, 95%);
18 | --color-gray-light-faded: hsla(215, 22%, 85%, 0.7);
19 | --color-gray-medium-faded: hsl(246, 11%, 32%, 0.2);
20 |
21 | --font-family-primary: 'Ubuntu', sans-serif;
22 | --font-family-secondary: 'Nanum Gothic', sans-serif;
23 | --font-family-mono: 'Ubuntu Mono', monospace;
24 |
25 | --font-family-icons: 'Material Icons';
26 |
27 | --font-weight-regular: 400;
28 | --font-weight-semi-bold: 600;
29 | --font-weight-bold: 700;
30 | }
31 |
32 | :root {
33 | --typography-lineHeight: 1.5;
34 | --typography-fontSize-px: 16;
35 | --typography-scale: 1.414;
36 |
37 | --typography-fontSize: calc((var(--typography-fontSize-px) / 16));
38 |
39 | --typography-scale-1: var(--typography-scale);
40 | --typography-scale-2: calc(var(--typography-scale-1) * var(--typography-scale));
41 | --typography-scale-3: calc(var(--typography-scale-2) * var(--typography-scale));
42 | --typography-scale-4: calc(var(--typography-scale-3) * var(--typography-scale));
43 | --typography-scale-5: calc(var(--typography-scale-4) * var(--typography-scale));
44 | --typography-scale-6: calc(var(--typography-scale-5) * var(--typography-scale));
45 |
46 | --font-size-smallest: calc((1 / var(--typography-scale-3)) * 1rem);
47 | --font-size-smaller: calc((1 / var(--typography-scale-2)) * 1rem);
48 | --font-size-small: calc((1 / var(--typography-scale-1)) * 1rem);
49 | --font-size-base: 1rem;
50 | --font-size-medium: calc(var(--typography-scale-1) * 1rem);
51 | --font-size-larger: calc(var(--typography-scale-2) * 1rem);
52 | --font-size-large: calc(var(--typography-scale-3) * 1rem);
53 | --font-size-xlarge: calc(var(--typography-scale-4) * 1rem);
54 | --font-size-xxlarge: calc(var(--typography-scale-5) * 1rem);
55 | --font-size-xxxlarge: calc(var(--typography-scale-6) * 1rem);
56 | }
57 |
58 | :root {
59 | --rhythmUnit: calc(var(--typography-lineHeight) * 1rem);
60 | --spacing-n5: calc(var(--rhythmUnit) / 6);
61 | --spacing-n4: calc(var(--rhythmUnit) / 5);
62 | --spacing-n3: calc(var(--rhythmUnit) / 4);
63 | --spacing-n2: calc(var(--rhythmUnit) / 3);
64 | --spacing-n1: calc(var(--rhythmUnit) / 2);
65 | --spacing-1: var(--rhythmUnit);
66 | --spacing-2: calc(2 * var(--rhythmUnit));
67 | --spacing-3: calc(3 * var(--rhythmUnit));
68 | --spacing-4: calc(4 * var(--rhythmUnit));
69 | --spacing-5: calc(5 * var(--rhythmUnit));
70 | --spacing-6: calc(6 * var(--rhythmUnit));
71 | --spacing-7: calc(7 * var(--rhythmUnit));
72 | --spacing-8: calc(8 * var(--rhythmUnit));
73 | --spacing-9: calc(9 * var(--rhythmUnit));
74 | --spacing-10: calc(10 * var(--rhythmUnit));
75 | }
76 |
77 |
78 | :root {
79 | --level-n1: -1;
80 | --level-2: 2;
81 | --level-3: 3;
82 | --level-4: 4;
83 | }
84 |
85 | :root {
86 | --container-max: 1600px;
87 | }
--------------------------------------------------------------------------------
/src/modules/tracker/TableDataRow.svelte:
--------------------------------------------------------------------------------
1 |
23 |
24 |
31 |
32 | {width} px
33 |
34 |
35 | {sizeValue} px
36 |
37 |
38 | {setToPrecision(sizeValue / $rootFontSize, 3)}rem
39 |
40 |
41 |
48 |
49 |
50 |
51 |
127 |
--------------------------------------------------------------------------------
/src/components/Footer.svelte:
--------------------------------------------------------------------------------
1 |
78 |
79 |
147 |
--------------------------------------------------------------------------------
/src/components/Header.svelte:
--------------------------------------------------------------------------------
1 |
40 |
41 |
101 |
102 |
223 |
--------------------------------------------------------------------------------
/src/styles/normalize.pcss:
--------------------------------------------------------------------------------
1 | /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
2 |
3 | /* Document
4 | ========================================================================== */
5 |
6 | /**
7 | * 1. Correct the line height in all browsers.
8 | * 2. Prevent adjustments of font size after orientation changes in iOS.
9 | */
10 |
11 | html {
12 | line-height: 1.15; /* 1 */
13 | -webkit-text-size-adjust: 100%; /* 2 */
14 | }
15 |
16 | /* Sections
17 | ========================================================================== */
18 |
19 | /**
20 | * Remove the margin in all browsers.
21 | */
22 |
23 | body {
24 | margin: 0;
25 | }
26 |
27 | /**
28 | * Render the `main` element consistently in IE.
29 | */
30 |
31 | main {
32 | display: block;
33 | }
34 |
35 | /**
36 | * Correct the font size and margin on `h1` elements within `section` and
37 | * `article` contexts in Chrome, Firefox, and Safari.
38 | */
39 |
40 | h1 {
41 | font-size: 2em;
42 | margin: 0.67em 0;
43 | }
44 |
45 | /* Grouping content
46 | ========================================================================== */
47 |
48 | /**
49 | * 1. Add the correct box sizing in Firefox.
50 | * 2. Show the overflow in Edge and IE.
51 | */
52 |
53 | hr {
54 | box-sizing: content-box; /* 1 */
55 | height: 0; /* 1 */
56 | overflow: visible; /* 2 */
57 | }
58 |
59 | /**
60 | * 1. Correct the inheritance and scaling of font size in all browsers.
61 | * 2. Correct the odd `em` font sizing in all browsers.
62 | */
63 |
64 | pre {
65 | font-family: monospace, monospace; /* 1 */
66 | font-size: 1em; /* 2 */
67 | }
68 |
69 | /* Text-level semantics
70 | ========================================================================== */
71 |
72 | /**
73 | * Remove the gray background on active links in IE 10.
74 | */
75 |
76 | a {
77 | background-color: transparent;
78 | }
79 |
80 | /**
81 | * 1. Remove the bottom border in Chrome 57-
82 | * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
83 | */
84 |
85 | abbr[title] {
86 | border-bottom: none; /* 1 */
87 | text-decoration: underline; /* 2 */
88 | text-decoration: underline dotted; /* 2 */
89 | }
90 |
91 | /**
92 | * Add the correct font weight in Chrome, Edge, and Safari.
93 | */
94 |
95 | b,
96 | strong {
97 | font-weight: bolder;
98 | }
99 |
100 | /**
101 | * 1. Correct the inheritance and scaling of font size in all browsers.
102 | * 2. Correct the odd `em` font sizing in all browsers.
103 | */
104 |
105 | code,
106 | kbd,
107 | samp {
108 | font-family: monospace, monospace; /* 1 */
109 | font-size: 1em; /* 2 */
110 | }
111 |
112 | /**
113 | * Add the correct font size in all browsers.
114 | */
115 |
116 | small {
117 | font-size: 80%;
118 | }
119 |
120 | /**
121 | * Prevent `sub` and `sup` elements from affecting the line height in
122 | * all browsers.
123 | */
124 |
125 | sub,
126 | sup {
127 | font-size: 75%;
128 | line-height: 0;
129 | position: relative;
130 | vertical-align: baseline;
131 | }
132 |
133 | sub {
134 | bottom: -0.25em;
135 | }
136 |
137 | sup {
138 | top: -0.5em;
139 | }
140 |
141 | /* Embedded content
142 | ========================================================================== */
143 |
144 | /**
145 | * Remove the border on images inside links in IE 10.
146 | */
147 |
148 | img {
149 | border-style: none;
150 | }
151 |
152 | /* Forms
153 | ========================================================================== */
154 |
155 | /**
156 | * 1. Change the font styles in all browsers.
157 | * 2. Remove the margin in Firefox and Safari.
158 | */
159 |
160 | button,
161 | input,
162 | optgroup,
163 | select,
164 | textarea {
165 | font-family: inherit; /* 1 */
166 | font-size: 100%; /* 1 */
167 | line-height: 1.15; /* 1 */
168 | margin: 0; /* 2 */
169 | }
170 |
171 | /**
172 | * Show the overflow in IE.
173 | * 1. Show the overflow in Edge.
174 | */
175 |
176 | button,
177 | input {
178 | /* 1 */
179 | overflow: visible;
180 | }
181 |
182 | /**
183 | * Remove the inheritance of text transform in Edge, Firefox, and IE.
184 | * 1. Remove the inheritance of text transform in Firefox.
185 | */
186 |
187 | button,
188 | select {
189 | /* 1 */
190 | text-transform: none;
191 | }
192 |
193 | /**
194 | * Correct the inability to style clickable types in iOS and Safari.
195 | */
196 |
197 | button,
198 | [type='button'],
199 | [type='reset'],
200 | [type='submit'] {
201 | -webkit-appearance: button;
202 | }
203 |
204 | /**
205 | * Remove the inner border and padding in Firefox.
206 | */
207 |
208 | button::-moz-focus-inner,
209 | [type='button']::-moz-focus-inner,
210 | [type='reset']::-moz-focus-inner,
211 | [type='submit']::-moz-focus-inner {
212 | border-style: none;
213 | padding: 0;
214 | }
215 |
216 | /**
217 | * Restore the focus styles unset by the previous rule.
218 | */
219 |
220 | button:-moz-focusring,
221 | [type='button']:-moz-focusring,
222 | [type='reset']:-moz-focusring,
223 | [type='submit']:-moz-focusring {
224 | outline: 1px dotted ButtonText;
225 | }
226 |
227 | /**
228 | * Correct the padding in Firefox.
229 | */
230 |
231 | fieldset {
232 | padding: 0.35em 0.75em 0.625em;
233 | }
234 |
235 | /**
236 | * 1. Correct the text wrapping in Edge and IE.
237 | * 2. Correct the color inheritance from `fieldset` elements in IE.
238 | * 3. Remove the padding so developers are not caught out when they zero out
239 | * `fieldset` elements in all browsers.
240 | */
241 |
242 | legend {
243 | box-sizing: border-box; /* 1 */
244 | color: inherit; /* 2 */
245 | display: table; /* 1 */
246 | max-width: 100%; /* 1 */
247 | padding: 0; /* 3 */
248 | white-space: normal; /* 1 */
249 | }
250 |
251 | /**
252 | * Add the correct vertical alignment in Chrome, Firefox, and Opera.
253 | */
254 |
255 | progress {
256 | vertical-align: baseline;
257 | }
258 |
259 | /**
260 | * Remove the default vertical scrollbar in IE 10+.
261 | */
262 |
263 | textarea {
264 | overflow: auto;
265 | }
266 |
267 | /**
268 | * 1. Add the correct box sizing in IE 10.
269 | * 2. Remove the padding in IE 10.
270 | */
271 |
272 | [type='checkbox'],
273 | [type='radio'] {
274 | box-sizing: border-box; /* 1 */
275 | padding: 0; /* 2 */
276 | }
277 |
278 | /**
279 | * Correct the cursor style of increment and decrement buttons in Chrome.
280 | */
281 |
282 | [type='number']::-webkit-inner-spin-button,
283 | [type='number']::-webkit-outer-spin-button {
284 | height: auto;
285 | }
286 |
287 | /**
288 | * 1. Correct the odd appearance in Chrome and Safari.
289 | * 2. Correct the outline style in Safari.
290 | */
291 |
292 | [type='search'] {
293 | -webkit-appearance: textfield; /* 1 */
294 | outline-offset: -2px; /* 2 */
295 | }
296 |
297 | /**
298 | * Remove the inner padding in Chrome and Safari on macOS.
299 | */
300 |
301 | [type='search']::-webkit-search-decoration {
302 | -webkit-appearance: none;
303 | }
304 |
305 | /**
306 | * 1. Correct the inability to style clickable types in iOS and Safari.
307 | * 2. Change font properties to `inherit` in Safari.
308 | */
309 |
310 | ::-webkit-file-upload-button {
311 | -webkit-appearance: button; /* 1 */
312 | font: inherit; /* 2 */
313 | }
314 |
315 | /* Interactive
316 | ========================================================================== */
317 |
318 | /*
319 | * Add the correct display in Edge, IE 10+, and Firefox.
320 | */
321 |
322 | details {
323 | display: block;
324 | }
325 |
326 | /*
327 | * Add the correct display in all browsers.
328 | */
329 |
330 | summary {
331 | display: list-item;
332 | }
333 |
334 | /* Misc
335 | ========================================================================== */
336 |
337 | /**
338 | * Add the correct display in IE 10+.
339 | */
340 |
341 | template {
342 | display: none;
343 | }
344 |
345 | /**
346 | * Add the correct display in IE 10.
347 | */
348 |
349 | [hidden] {
350 | display: none;
351 | }
352 |
--------------------------------------------------------------------------------
/src/routes/about.svelte:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 | About the project & user guide
8 |
9 |
10 |
11 |
12 | I was going through Josh Comeau's
17 | CSS for JS devs
18 | course which is one of the best courses on CSS in general and I recommend checking it out.
19 | In one of the lessions, Josh implemented a simple fluid typography editor, mainly for
20 | demonstration purposes to showcase how fluid typography changes depending on the screen size.
21 |
22 |
23 | I saw an opportunity for doing a really fun and useful project . I set out to
24 | build upon Josh's concept and developed a fully-fledged tool that developers could use on a
25 | day-to-day basis to fine-tune and keep track of their fluid typography and help to keep fluid
26 | typography behavior consistent across the significant breakpoints.
27 |
28 |
29 |
30 |
31 | Fluid typography
32 |
33 | Fluid typography is a modern way of approaching responsive typography. Instead of setting
34 | fixed typography values for individual screen sizes, we can set a single fluid value and let
35 | the CSS render the appropriate values for a specific screen size constrained by minimum and
36 | maximum values.
37 |
38 |
39 |
40 | Try resizing the screen and notice how the "About the project & user guide" adapts to screen
41 | size, but is constrained at some specific minimum and maximum value. Cool, isn't it?
42 |
43 |
44 |
45 |
46 | CSS clamp and browser support
47 |
48 | This editor relies heavily on CSS clamp
53 | and generates code using this property. Although this property has a solid browser support
54 | (above 90% of globally used browsers), you might want to use a polyfill or a fallback value if
55 | you need to support legacy browsers like Internet Explorer.
56 |
57 |
58 |
59 |
60 | Configurable values
61 |
62 |
63 | clamp(min-value, fluid-value + relative-value, max-value);
64 |
65 |
66 |
67 |
68 | min-value & max-value
69 | Minimum and maximum value constraints.
70 |
71 | fluid-value
72 |
73 | Change speed (rate). If a value is positive, the final value will increase from minimum
74 | value to maximum value as screen width increases. If this value is negative, the final value
75 | will decrease from maximum value to minimal value as screen width increases.
76 |
77 | relative-size
78 |
79 | Browser default root font size is 16px. This value can be changed by users in their browser
80 | settings, usually for accessibility purposes. Positive or negative "rem" values should be
81 | included to avoid locking font size to px value and to support user font size preferences.
82 |
83 |
84 |
85 |
86 |
87 | Features
88 | Here is a short overview of some of the features of this editor:
89 |
90 | Adjust size constraints, rate, and relative size
91 | Adapts to any root font size
92 | Graphical overview of the final fluid values
93 | Table view for keeping track of values on fixed screen width sizes.
94 |
95 | Adjusting fluid settings
96 |
97 | Fluid typography settings can be easily adjusted either by using numerical inputs for more
98 | precise inputs or using range inputs for fine-tuning and smaller changes to easily track
99 | changes on the graph or table.
100 |
101 |
102 |
103 |
104 | Use editor to configure min and max constraints, change rate and direction and relative
105 | sizing for user font preferences
106 |
107 |
108 | Code snippet
109 |
110 | Based on the configured fluid settings, a CSS clamp code is generated. You can easily
111 | copy the value by clicking the button on the left side or by selecting the value and copying it
112 | manually.
113 |
114 |
115 |
119 |
120 | The code snippet can be copied by clicking the button or by selecting the text and copying
121 | manually
122 |
123 |
124 | Graph view
125 |
126 | Graph view can give you a general overview of fluid typography behavior. By hovering over the
127 | graph you can inspect individual values on specific screen sizes.
128 |
129 |
130 |
134 |
135 | A high-level overview of fluid typography behavior. Fluid value starts increasing from
136 | min-size to max size at around 400px of the viewport width and it stops at a maximum value
137 | at around 1000px,
138 |
139 |
140 |
141 | For a more detailed overview or tracking specific screen sizes, you can use the table view.
142 |
143 | Table view
144 |
145 |
146 | A table view can give you a more detailed overview of fluid font sizes for specific viewport
147 | sizes. Viewport sizes can be easily added using the adjacent input. Likewise, individual
148 | values can be removed from the list by clicking the remove button for a specific value.
149 |
150 |
151 |
152 |
156 |
157 | Minimum, maximum, and fluid values are indicated in the table and values can be sorted by
158 | screen size in ascending or descending order.
159 |
160 |
161 |
162 |
163 |
164 | Issues and contribution
165 |
166 | Found any bugs or have a suggestion? Feel free to open an issue in
167 |
172 | project's GitHub repository
173 | .
174 |
175 |
176 | Feel free to contribute code to the project by
177 |
182 | forking the source code
183 | . Please consult the "Issues" tab or contact me directly as unsolicited code contributions
184 | may be rejected if they're not necessary or if they harm code quality, performance or
185 | functionality.
186 |
187 |
188 |
189 |
190 |
348 |
--------------------------------------------------------------------------------