diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 3ccf435f0..dc1500d4e 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,20 +1,20 @@ module.exports = { - root: true, - parser: '@typescript-eslint/parser', - extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'], - plugins: ['svelte3', '@typescript-eslint'], - ignorePatterns: ['*.cjs'], - overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }], - settings: { - 'svelte3/typescript': () => require('typescript') - }, - parserOptions: { - sourceType: 'module', - ecmaVersion: 2020 - }, - env: { - browser: true, - es2017: true, - node: true - } + root: true, + parser: '@typescript-eslint/parser', + extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'], + plugins: ['svelte3', '@typescript-eslint'], + ignorePatterns: ['*.cjs'], + overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }], + settings: { + 'svelte3/typescript': () => require('typescript'), + }, + parserOptions: { + sourceType: 'module', + ecmaVersion: 2020, + }, + env: { + browser: true, + es2017: true, + node: true, + }, }; diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1f130b263..95d64b952 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -3,16 +3,16 @@ name: Deploy on: push jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Wait for CF Pages - id: cf-pages - uses: WalshyDev/cf-pages-await@v1 - with: - accountEmail: ${{ secrets.CF_ACCOUNT_EMAIL }} - apiKey: ${{ secrets.CF_API_KEY }} - accountId: '9ddae624c98677d68d93df6e524a6061' - project: 'omorphia' - githubToken: ${{ secrets.GITHUB_TOKEN }} + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Wait for CF Pages + id: cf-pages + uses: WalshyDev/cf-pages-await@v1 + with: + accountEmail: ${{ secrets.CF_ACCOUNT_EMAIL }} + apiKey: ${{ secrets.CF_API_KEY }} + accountId: '9ddae624c98677d68d93df6e524a6061' + project: 'omorphia' + githubToken: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e88d3826c..9f02b4155 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,50 +1,50 @@ name: Release on: - push: - branches: - - 'main' + push: + branches: + - 'main' jobs: - release: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 - - uses: pnpm/action-setup@v2.1.0 - with: - version: 6.32.0 + - uses: pnpm/action-setup@v2.1.0 + with: + version: 6.32.0 - - name: Setup Node - uses: actions/setup-node@v2 - with: - node-version: '14' - registry-url: 'https://registry.npmjs.org' + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: '14' + registry-url: 'https://registry.npmjs.org' - - name: Cache pnpm modules - uses: actions/cache@v2 - with: - path: ~/.pnpm-store - key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}- + - name: Cache pnpm modules + uses: actions/cache@v2 + with: + path: ~/.pnpm-store + key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}- - - name: Install dependencies - run: pnpm install + - name: Install dependencies + run: pnpm install - - name: Package - run: | - pnpm version patch --commit-hooks false --git-tag-version false - pnpm package + - name: Package + run: | + pnpm version patch --commit-hooks false --git-tag-version false + pnpm package - - name: Publish - run: | - cd package - pnpm publish --no-git-checks --tag alpha - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Publish + run: | + cd package + pnpm publish --no-git-checks --tag alpha + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - uses: EndBug/add-and-commit@v9 - with: - message: 'Bump package version [skip ci]' - default_author: github_actions + - uses: EndBug/add-and-commit@v9 + with: + message: 'Bump package version [skip ci]' + default_author: github_actions diff --git a/.prettierrc b/.prettierrc index d97685376..b87484352 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,5 @@ { - "singleQuote": true, - "printWidth": 100, + "singleQuote": true, + "printWidth": 100, "tabWidth": 4 } diff --git a/mdsvex.config.js b/mdsvex.config.js index 2e8d396e7..6f7d4528f 100644 --- a/mdsvex.config.js +++ b/mdsvex.config.js @@ -1,28 +1,28 @@ import { defineMDSveXConfig as defineConfig } from 'mdsvex'; -import examples from 'mdsvexamples' +import examples from 'mdsvexamples'; const config = defineConfig({ - extensions: ['.svelte.md', '.md', '.svx'], + extensions: ['.svelte.md', '.md', '.svx'], - smartypants: { - dashes: 'oldschool', - }, + smartypants: { + dashes: 'oldschool', + }, - remarkPlugins: [ - [ - examples, - { - defaults: { - Wrapper: '$routes/_internal/components/Example.svelte' - } - } - ] - ], - rehypePlugins: [], + remarkPlugins: [ + [ + examples, + { + defaults: { + Wrapper: '$routes/_internal/components/Example.svelte', + }, + }, + ], + ], + rehypePlugins: [], - layout: { - _: "./src/routes/_internal/layout/page.svelte", - } + layout: { + _: './src/routes/_internal/layout/page.svelte', + }, }); export default config; diff --git a/plugins/sveld.js b/plugins/sveld.js index a4803fbd9..771fd1d3c 100644 --- a/plugins/sveld.js +++ b/plugins/sveld.js @@ -1,55 +1,58 @@ -import {ComponentParser} from 'sveld' -import * as svelte from 'svelte/compiler' -import fs from 'fs/promises' -import path from 'path' -import {preprocess} from "../src/package/config/svelte.config.js"; +import { ComponentParser } from 'sveld'; +import * as svelte from 'svelte/compiler'; +import fs from 'fs/promises'; +import path from 'path'; +import { preprocess } from '../src/package/config/svelte.config.js'; export default function sveld() { return { name: 'vite-plugin-sveld', async transform(src, id) { if (id.endsWith('?raw&sveld')) { - const raw = JSON.parse(src.split('export default ')[1]) + const raw = JSON.parse(src.split('export default ')[1]); - const data = await parseRaw(raw, id) + const data = await parseRaw(raw, id); return { code: `export default ${JSON.stringify(data)}`, - map: null - } + map: null, + }; } }, // This generates a `COMPONENT_API.json` with sveld in the `/_app` folder on build, which is used by the docs about components (only when built statically) async buildStart() { const output = {}; - const componentFiles = await fs.readdir(path.resolve('./src/package/components')) + const componentFiles = await fs.readdir(path.resolve('./src/package/components')); for (const fileName of componentFiles) { - const filePath = path.resolve('./src/package/components', fileName) - const raw = (await fs.readFile(filePath)).toString() - output[fileName] = await parseRaw(raw, filePath) + const filePath = path.resolve('./src/package/components', fileName); + const raw = (await fs.readFile(filePath)).toString(); + output[fileName] = await parseRaw(raw, filePath); } try { - await fs.mkdir(path.resolve('./src/generated')) + await fs.mkdir(path.resolve('./src/generated')); } catch { // Do nothing, directory already exists } - await fs.writeFile(path.resolve('./src/generated/COMPONENT_API.json'), JSON.stringify(output)) + await fs.writeFile( + path.resolve('./src/generated/COMPONENT_API.json'), + JSON.stringify(output) + ); }, - } + }; } async function parseRaw(raw, filePath) { let { code } = await svelte.preprocess(raw, preprocess, { - filename: filePath - }) + filename: filePath, + }); return new ComponentParser({ - verbose: false + verbose: false, }).parseSvelteComponent(code, { filePath, - moduleName: filePath - }) -} \ No newline at end of file + moduleName: filePath, + }); +} diff --git a/postcss.config.cjs b/postcss.config.cjs index 2c060fa35..a22eb12b9 100644 --- a/postcss.config.cjs +++ b/postcss.config.cjs @@ -1 +1 @@ -module.exports = require('./src/package/config/postcss.config.cjs') \ No newline at end of file +module.exports = require('./src/package/config/postcss.config.cjs'); diff --git a/src/app.d.ts b/src/app.d.ts index 36396ad5c..447143ad2 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -4,8 +4,8 @@ // See https://kit.svelte.dev/docs/types#the-app-namespace // for information about these interfaces declare namespace App { - // interface Locals {} - // interface Platform {} - // interface Session {} - // interface Stuff {} + // interface Locals {} + // interface Platform {} + // interface Session {} + // interface Stuff {} } diff --git a/src/app.html b/src/app.html index e563b4146..7c079c0e0 100644 --- a/src/app.html +++ b/src/app.html @@ -1,19 +1,19 @@ - - - - - + + + + + - - - - + + + + - %svelte.head% - - - %svelte.body% - + %svelte.head% + + + %svelte.body% + diff --git a/src/global.d.ts b/src/global.d.ts index 445c93c65..73f8fc433 100644 --- a/src/global.d.ts +++ b/src/global.d.ts @@ -1 +1 @@ -/// \ No newline at end of file +/// diff --git a/src/package/config/postcss.config.cjs b/src/package/config/postcss.config.cjs index 8eade62bb..75ef8248d 100644 --- a/src/package/config/postcss.config.cjs +++ b/src/package/config/postcss.config.cjs @@ -17,15 +17,16 @@ const config = { '--xl': '(min-width: 1280px)', }, }, - ] - } - } + ], + }, + }, }), require('postcss-pxtorem'), require('autoprefixer'), - process.env.NODE_ENV === 'development' && require('cssnano')({ - preset: 'default', - }) + process.env.NODE_ENV === 'development' && + require('cssnano')({ + preset: 'default', + }), ], }; diff --git a/src/package/plugins/generator/outputs/landingPage.ts b/src/package/plugins/generator/outputs/landingPage.ts index 7e51e029e..c0ce10cdf 100644 --- a/src/package/plugins/generator/outputs/landingPage.ts +++ b/src/package/plugins/generator/outputs/landingPage.ts @@ -1,7 +1,5 @@ import { fetch } from 'undici'; import { promises as fs } from 'fs'; -import sharp from 'sharp'; -import FastAverageColor from 'fast-average-color'; import cliProgress from 'cli-progress'; export async function landingPage(API_URL: string) { diff --git a/src/package/styles.postcss b/src/package/styles.postcss index 962420f45..90cbf089f 100644 --- a/src/package/styles.postcss +++ b/src/package/styles.postcss @@ -1,4 +1,4 @@ @import-glob "./styles/normalize.postcss"; /* Doesn't need to glob but fixes warning */ @import-glob "./styles/themes/**.postcss"; @import-glob "./styles/variables/**.postcss"; -@import-glob "./styles/classes/**.postcss"; \ No newline at end of file +@import-glob "./styles/classes/**.postcss"; diff --git a/src/package/styles/classes/actions.postcss b/src/package/styles/classes/actions.postcss index 5e19409c4..b4efd4891 100644 --- a/src/package/styles/classes/actions.postcss +++ b/src/package/styles/classes/actions.postcss @@ -17,4 +17,4 @@ align-items: flex-start; margin-left: unset; } -} \ No newline at end of file +} diff --git a/src/package/styles/classes/button-group.postcss b/src/package/styles/classes/button-group.postcss index 304138b64..1291d3ce1 100644 --- a/src/package/styles/classes/button-group.postcss +++ b/src/package/styles/classes/button-group.postcss @@ -2,4 +2,4 @@ display: flex; grid-gap: 0.5rem; flex-wrap: wrap; -} \ No newline at end of file +} diff --git a/src/package/styles/classes/card.postcss b/src/package/styles/classes/card.postcss index cf87dfb00..cb29f63c0 100644 --- a/src/package/styles/classes/card.postcss +++ b/src/package/styles/classes/card.postcss @@ -98,4 +98,4 @@ p { line-height: 130%; } -} \ No newline at end of file +} diff --git a/src/package/styles/classes/divider.postcss b/src/package/styles/classes/divider.postcss index 9ca4de819..51d28c563 100644 --- a/src/package/styles/classes/divider.postcss +++ b/src/package/styles/classes/divider.postcss @@ -3,4 +3,4 @@ border: none; border-top: 1px solid var(--color-divider); width: 100%; -} \ No newline at end of file +} diff --git a/src/package/styles/classes/illustration.postcss b/src/package/styles/classes/illustration.postcss index 30c8dc73c..5ea1c506e 100644 --- a/src/package/styles/classes/illustration.postcss +++ b/src/package/styles/classes/illustration.postcss @@ -11,6 +11,6 @@ &__description { font-size: 1.2rem; - color: var(--color-text-light) + color: var(--color-text-light); } -} \ No newline at end of file +} diff --git a/src/package/styles/classes/info-table.postcss b/src/package/styles/classes/info-table.postcss index ea7c7708a..3423524c9 100644 --- a/src/package/styles/classes/info-table.postcss +++ b/src/package/styles/classes/info-table.postcss @@ -8,4 +8,4 @@ color: var(--color-text-lightest); font-weight: var(--font-weight-medium); } -} \ No newline at end of file +} diff --git a/src/package/styles/classes/link.postcss b/src/package/styles/classes/link.postcss index 2e8bdfca4..0a0f0921c 100644 --- a/src/package/styles/classes/link.postcss +++ b/src/package/styles/classes/link.postcss @@ -20,7 +20,6 @@ &:hover { color: var(--color-link); - } } -} \ No newline at end of file +} diff --git a/src/package/styles/classes/markdown.postcss b/src/package/styles/classes/markdown.postcss index cd3823fc4..0977c1993 100644 --- a/src/package/styles/classes/markdown.postcss +++ b/src/package/styles/classes/markdown.postcss @@ -134,4 +134,4 @@ margin: 0; padding: 0; } -} \ No newline at end of file +} diff --git a/src/package/styles/classes/member.postcss b/src/package/styles/classes/member.postcss index 4a9f3a43d..d55bd881a 100644 --- a/src/package/styles/classes/member.postcss +++ b/src/package/styles/classes/member.postcss @@ -10,4 +10,4 @@ font-weight: var(--font-weight-medium); } } -} \ No newline at end of file +} diff --git a/src/package/styles/classes/tag.postcss b/src/package/styles/classes/tag.postcss index 5e50b16d2..2e5917cb6 100644 --- a/src/package/styles/classes/tag.postcss +++ b/src/package/styles/classes/tag.postcss @@ -15,4 +15,4 @@ flex-wrap: wrap; margin-top: auto; grid-gap: 0.25rem 0.6rem; -} \ No newline at end of file +} diff --git a/src/package/styles/classes/title.postcss b/src/package/styles/classes/title.postcss index 372a0bbe1..5c464339b 100644 --- a/src/package/styles/classes/title.postcss +++ b/src/package/styles/classes/title.postcss @@ -11,4 +11,4 @@ .title-tertiary { font-size: 16px; font-weight: var(--font-weight-bold); -} \ No newline at end of file +} diff --git a/src/package/styles/normalize.postcss b/src/package/styles/normalize.postcss index 0709dd19e..c165d9176 100644 --- a/src/package/styles/normalize.postcss +++ b/src/package/styles/normalize.postcss @@ -55,8 +55,8 @@ ul { } .icon { - height: auto; - width: 16px; - min-width: 16px; - aspect-ratio: 1 / 1; -} \ No newline at end of file + height: auto; + width: 16px; + min-width: 16px; + aspect-ratio: 1 / 1; +} diff --git a/src/package/styles/themes/base.postcss b/src/package/styles/themes/base.postcss index 318bb342b..fc716f4b5 100644 --- a/src/package/styles/themes/base.postcss +++ b/src/package/styles/themes/base.postcss @@ -6,7 +6,7 @@ --rounded-max: 999999999px; --font-standard: Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Oxygen, Ubuntu, Roboto, - Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; + Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; --font-size-nm: 1rem; /* 16px */ --font-size-xl: 1.5rem; /* 24px */ diff --git a/src/package/styles/themes/dark.postcss b/src/package/styles/themes/dark.postcss index 2a56cccf8..a4b1f0126 100644 --- a/src/package/styles/themes/dark.postcss +++ b/src/package/styles/themes/dark.postcss @@ -16,7 +16,7 @@ --shadow-raised-lg: 0px 2px 4px hsla(221, 39%, 11%, 0.2); --shadow-raised: 0px -2px 4px hsla(221, 39%, 11%, 0.1); --shadow-floating: hsla(0, 0%, 0%, 0) 0px 0px 0px 0px, hsla(0, 0%, 0%, 0) 0px 0px 0px 0px, - hsla(0, 0%, 0%, 0.1) 0px 4px 6px -1px, rgba(0, 0, 0, 0.06) 0px 2px 4px -1px; + hsla(0, 0%, 0%, 0.1) 0px 4px 6px -1px, rgba(0, 0, 0, 0.06) 0px 2px 4px -1px; --shadow-mobile-bar: hsla(0, 0%, 0%, 0.3) 0 0 20px 2px; /* Text colors */ diff --git a/src/package/styles/themes/light.postcss b/src/package/styles/themes/light.postcss index af2811cca..c8aba7682 100644 --- a/src/package/styles/themes/light.postcss +++ b/src/package/styles/themes/light.postcss @@ -16,7 +16,7 @@ --shadow-raised-lg: 0px 2px 4px hsla(221, 39%, 11%, 0.2); --shadow-raised: 0px 2px 4px hsla(221, 39%, 11%, 0.1); --shadow-floating: hsla(0, 0%, 0%, 0) 0px 0px 0px 0px, hsla(0, 0%, 0%, 0) 0px 0px 0px 0px, - hsla(0, 0%, 0%, 0.1) 0px 4px 6px -1px, hsla(0, 0%, 0%, 0.1) 0px 2px 4px -1px; + hsla(0, 0%, 0%, 0.1) 0px 4px 6px -1px, hsla(0, 0%, 0%, 0.1) 0px 2px 4px -1px; --shadow-mobile-bar: hsla(0, 0%, 0%, 0.3) 0 0 20px 2px; /* Text colors */ diff --git a/src/package/styles/variables/borders.postcss b/src/package/styles/variables/borders.postcss index bb8816110..70c72480f 100644 --- a/src/package/styles/variables/borders.postcss +++ b/src/package/styles/variables/borders.postcss @@ -1,16 +1,16 @@ :root { - /* Borders */ - --border-width: 1px; - --border-style: solid; - --border: var(--border-width) var(--border-style); + /* Borders */ + --border-width: 1px; + --border-style: solid; + --border: var(--border-width) var(--border-style); - /* Rounded radii */ - --rounded-sm: 8px; - --rounded: 10px; - --rounded-lg: 12px; - --rounded-max: 100px; - --rounded-top: var(--rounded) var(--rounded) 0 0; - --rounded-bottom: 0 0 var(--rounded) var(--rounded); - --rounded-sm-top: var(--rounded-sm) var(--rounded-sm) 0 0; - --rounded-sm-bottom: 0 0 var(--rounded-sm) var(--rounded-sm); -} \ No newline at end of file + /* Rounded radii */ + --rounded-sm: 8px; + --rounded: 10px; + --rounded-lg: 12px; + --rounded-max: 100px; + --rounded-top: var(--rounded) var(--rounded) 0 0; + --rounded-bottom: 0 0 var(--rounded) var(--rounded); + --rounded-sm-top: var(--rounded-sm) var(--rounded-sm) 0 0; + --rounded-sm-bottom: 0 0 var(--rounded-sm) var(--rounded-sm); +} diff --git a/src/package/styles/variables/spacing.postcss b/src/package/styles/variables/spacing.postcss index 2e1972fa3..a299f9ff9 100644 --- a/src/package/styles/variables/spacing.postcss +++ b/src/package/styles/variables/spacing.postcss @@ -1,7 +1,6 @@ :root { - - /* these are values for the display CSS property */ - /* + /* these are values for the display CSS property */ + /* --display-values: ( block, flex, @@ -22,7 +21,7 @@ ); */ - /* + /* These are our margin and padding utility spacers. The default step size we use is 8px. This gives us a key of: 0 => 0px @@ -32,18 +31,18 @@ 4 => 24px 5 => 32px 6 => 40px */ - --spacer: 8px; + --spacer: 8px; - /* Our spacing scale */ - --spacer-0: 0; /* 0 */ - --spacer-1: calc(var(--spacer) * 0.5); /* 4px */ - --spacer-2: --spacer; /* 8px */ - --spacer-3: calc(var(--spacer) * 2); /* 16px */ - --spacer-4: calc(var(--spacer) * 3); /* 24px */ - --spacer-5: calc(var(--spacer) * 4); /* 32px */ - --spacer-6: calc(var(--spacer) * 5); /* 40px */ + /* Our spacing scale */ + --spacer-0: 0; /* 0 */ + --spacer-1: calc(var(--spacer) * 0.5); /* 4px */ + --spacer-2: --spacer; /* 8px */ + --spacer-3: calc(var(--spacer) * 2); /* 16px */ + --spacer-4: calc(var(--spacer) * 3); /* 24px */ + --spacer-5: calc(var(--spacer) * 4); /* 32px */ + --spacer-6: calc(var(--spacer) * 5); /* 40px */ - /* + /* /* The list of spacer values --spacers: ( --spacer-0, @@ -210,4 +209,4 @@ @custom-media --sm (min-width: 544px); @custom-media --md (min-width: 768px); @custom-media --lg (min-width: 1012px); -@custom-media --xl (min-width: 544px); \ No newline at end of file +@custom-media --xl (min-width: 544px); diff --git a/src/package/styles/variables/typography.postcss b/src/package/styles/variables/typography.postcss index 85fd59763..8e503169c 100644 --- a/src/package/styles/variables/typography.postcss +++ b/src/package/styles/variables/typography.postcss @@ -1,38 +1,39 @@ :root { - /* Heading sizes - mobile */ - /* h4-h6 remain the same size on both mobile & desktop */ - --h00-size-mobile: 40px; - --h0-size-mobile: 32px; - --h1-size-mobile: 26px; - --h2-size-mobile: 22px; - --h3-size-mobile: 18px; + /* Heading sizes - mobile */ + /* h4-h6 remain the same size on both mobile & desktop */ + --h00-size-mobile: 40px; + --h0-size-mobile: 32px; + --h1-size-mobile: 26px; + --h2-size-mobile: 22px; + --h3-size-mobile: 18px; - /* Heading sizes - desktop */ - --h00-size: 48px; - --h0-size: 40px; - --h1-size: 32px; - --h2-size: 24px; - --h3-size: 20px; - --h4-size: 16px; - --h5-size: 14px; - --h6-size: 12px; + /* Heading sizes - desktop */ + --h00-size: 48px; + --h0-size: 40px; + --h1-size: 32px; + --h2-size: 24px; + --h3-size: 20px; + --h4-size: 16px; + --h5-size: 14px; + --h6-size: 12px; - --font-size-lg: 19px; - --font-size-sm: 13px; - --font-size: 16px; + --font-size-lg: 19px; + --font-size-sm: 13px; + --font-size: 16px; - /* Line heights */ - --lh-condensed-ultra: 1; - --lh-condensed: 1.25; - --lh-default: 1.5; + /* Line heights */ + --lh-condensed-ultra: 1; + --lh-condensed: 1.25; + --lh-default: 1.5; - /* Font weights */ - --font-weight-light: 300; - --font-weight-normal: 400; - --font-weight-semibold: 500; - --font-weight-bold: 600; + /* Font weights */ + --font-weight-light: 300; + --font-weight-normal: 400; + --font-weight-semibold: 500; + --font-weight-bold: 600; - /* Font stacks */ - --body-font: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'; - --mono-font: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace; -} \ No newline at end of file + /* Font stacks */ + --body-font: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, + 'Apple Color Emoji', 'Segoe UI Emoji'; + --mono-font: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace; +} diff --git a/src/package/utils/ago.ts b/src/package/utils/ago.ts index 4a5e86830..9898ba6f9 100644 --- a/src/package/utils/ago.ts +++ b/src/package/utils/ago.ts @@ -4,54 +4,56 @@ * @see https://stackoverflow.com/a/67338038/938822 */ export function ago( - /** A Date object, timestamp or string parsable with Date.parse() */ - date: string | number | Date, - /** A Date object, timestamp or string parsable with Date.parse() */ - nowDate: string | number | Date = Date.now(), - /** A Intl formater */ - rft: Intl.RelativeTimeFormat = new Intl.RelativeTimeFormat(undefined, { numeric: 'auto' }) + /** A Date object, timestamp or string parsable with Date.parse() */ + date: string | number | Date, + /** A Date object, timestamp or string parsable with Date.parse() */ + nowDate: string | number | Date = Date.now(), + /** A Intl formater */ + rft: Intl.RelativeTimeFormat = new Intl.RelativeTimeFormat(undefined, { numeric: 'auto' }) ): string { - const SECOND = 1000; - const MINUTE = 60 * SECOND; - const HOUR = 60 * MINUTE; - const DAY = 24 * HOUR; - const WEEK = 7 * DAY; - const MONTH = 30 * DAY; - const YEAR = 365 * DAY; - const intervals = [ - { ge: YEAR, divisor: YEAR, unit: 'year' }, - { ge: MONTH, divisor: MONTH, unit: 'month' }, - { ge: WEEK, divisor: WEEK, unit: 'week' }, - { ge: DAY, divisor: DAY, unit: 'day' }, - { ge: HOUR, divisor: HOUR, unit: 'hour' }, - { ge: MINUTE, divisor: MINUTE, unit: 'minute' }, - { ge: 30 * SECOND, divisor: SECOND, unit: 'seconds' }, - { ge: 0, divisor: 1, text: 'just now' }, - ]; - const now = typeof nowDate === 'object' ? nowDate.getTime() : new Date(nowDate).getTime(); - const diff = now - (typeof date === 'object' ? date : new Date(date)).getTime(); - const diffAbs = Math.abs(diff); - for (const interval of intervals) { - if (diffAbs >= interval.ge) { - const x = Math.round(Math.abs(diff) / interval.divisor); - const isFuture = diff < 0; - return interval.unit ? rft.format(isFuture ? x : -x, interval.unit as Unit) : interval.text; - } - } + const SECOND = 1000; + const MINUTE = 60 * SECOND; + const HOUR = 60 * MINUTE; + const DAY = 24 * HOUR; + const WEEK = 7 * DAY; + const MONTH = 30 * DAY; + const YEAR = 365 * DAY; + const intervals = [ + { ge: YEAR, divisor: YEAR, unit: 'year' }, + { ge: MONTH, divisor: MONTH, unit: 'month' }, + { ge: WEEK, divisor: WEEK, unit: 'week' }, + { ge: DAY, divisor: DAY, unit: 'day' }, + { ge: HOUR, divisor: HOUR, unit: 'hour' }, + { ge: MINUTE, divisor: MINUTE, unit: 'minute' }, + { ge: 30 * SECOND, divisor: SECOND, unit: 'seconds' }, + { ge: 0, divisor: 1, text: 'just now' }, + ]; + const now = typeof nowDate === 'object' ? nowDate.getTime() : new Date(nowDate).getTime(); + const diff = now - (typeof date === 'object' ? date : new Date(date)).getTime(); + const diffAbs = Math.abs(diff); + for (const interval of intervals) { + if (diffAbs >= interval.ge) { + const x = Math.round(Math.abs(diff) / interval.divisor); + const isFuture = diff < 0; + return interval.unit + ? rft.format(isFuture ? x : -x, interval.unit as Unit) + : interval.text; + } + } } type Unit = - | 'second' - | 'seconds' - | 'minute' - | 'minutes' - | 'hour' - | 'hours' - | 'day' - | 'days' - | 'week' - | 'weeks' - | 'month' - | 'months' - | 'year' - | 'years'; + | 'second' + | 'seconds' + | 'minute' + | 'minutes' + | 'hour' + | 'hours' + | 'day' + | 'days' + | 'week' + | 'weeks' + | 'month' + | 'months' + | 'year' + | 'years'; diff --git a/src/package/utils/classCombine.ts b/src/package/utils/classCombine.ts index 2f1761fbf..56f3b42d2 100644 --- a/src/package/utils/classCombine.ts +++ b/src/package/utils/classCombine.ts @@ -1,3 +1,3 @@ export function classCombine(names) { - return names.filter(name => name && !name.includes('undefined')).join(' ') -} \ No newline at end of file + return names.filter((name) => name && !name.includes('undefined')).join(' '); +} diff --git a/src/package/utils/index.ts b/src/package/utils/index.ts index ec9a630a5..76e34cdeb 100644 --- a/src/package/utils/index.ts +++ b/src/package/utils/index.ts @@ -1,4 +1,4 @@ export { ago } from './ago'; export { simplify } from './number'; export { Permissions } from './permissions'; -export { formatVersions } from './versions'; \ No newline at end of file +export { formatVersions } from './versions'; diff --git a/src/package/utils/number.ts b/src/package/utils/number.ts deleted file mode 100644 index fa32b0486..000000000 --- a/src/package/utils/number.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Convert large numbers to human readable strings - * @source https://github.com/rohmanhm/simplify-number - */ -export function simplify(num = 0): string { - let numberVar = num; - - // 2 decimal places => 100, 3 => 1000, etc - const decPlaces = Math.pow(10, 1); - - // Enumerate number abbreviations - const abbrev = ['K', 'M', 'B', 'T']; - - // Go through the array backwards, so we do the largest first - for (let i = abbrev.length - 1; i >= 0; i--) { - // Convert array index to "1000", "1000000", etc - const size = Math.pow(10, (i + 1) * 3); - - // If the number is bigger or equal do the abbreviation - if (size <= numberVar) { - // Here, we multiply by decPlaces, round, and then divide by decPlaces. - // This gives us nice rounding to a particular decimal place. - numberVar = Math.round((numberVar * decPlaces) / size) / decPlaces; - - // Handle special case where we round up to the next abbreviation - if (numberVar === 1000 && i < abbrev.length - 1) { - numberVar = 1; - i++; - } - - // Add the letter for the abbreviation - (numberVar as any) += abbrev[i]; - - // We are done... stop - break; - } - } - - return String(numberVar); -} diff --git a/src/package/utils/parse.ts b/src/package/utils/parse.ts index 7cc81ee73..d17e2c454 100644 --- a/src/package/utils/parse.ts +++ b/src/package/utils/parse.ts @@ -5,130 +5,130 @@ import insane from 'insane'; const renderer = new marked.Renderer(); renderer.image = (href, text) => { - if (/^https?:\/\/(www\.)?youtube\.com\/watch\?v=[a-zA-Z0-9_]{11}$/.test(href)) { - const id = href.substring(32, 43); - return ``; - } else { - return `${text}`; - } + if (/^https?:\/\/(www\.)?youtube\.com\/watch\?v=[a-zA-Z0-9_]{11}$/.test(href)) { + const id = href.substring(32, 43); + return ``; + } else { + return `${text}`; + } }; renderer.link = (href, title, text) => { - if (href === null) { - return text; - } - let out = ''; - return out; + if (href === null) { + return text; + } + let out = ''; + return out; }; marked.setOptions({ - renderer, - highlight: function (code, lang) { - const language = hljs.getLanguage(lang) ? lang : 'plaintext'; - return hljs.highlight(code, { language }).value; - }, - langPrefix: 'hljs language-', - headerPrefix: '', - gfm: true, - smartLists: true, + renderer, + highlight: function (code, lang) { + const language = hljs.getLanguage(lang) ? lang : 'plaintext'; + return hljs.highlight(code, { language }).value; + }, + langPrefix: 'hljs language-', + headerPrefix: '', + gfm: true, + smartLists: true, }); function sanitize(html: string): string { - return insane(html, { - allowedAttributes: { - a: ['href', 'name', 'target', 'title', 'rel'], - iframe: ['allowfullscreen', 'src', 'width', 'height'], - img: ['src', 'width', 'height', 'alt'], - h1: ['id'], - h2: ['id'], - h3: ['id'], - h4: ['id'], - h5: ['id'], - h6: ['id'], - code: ['class'], - span: ['class'], - input: ['type', 'checked', 'disabled'], - font: ['color'], - }, - allowedClasses: {}, - allowedSchemes: ['http', 'https', 'mailto'], - allowedTags: [ - 'a', - 'b', - 'blockquote', - 'br', - 'caption', - 'center', - 'code', - 'del', - 'details', - 'div', - 'em', - 'font', - 'h1', - 'h2', - 'h3', - 'h4', - 'h5', - 'h6', - 'hr', - 'i', - 'iframe', - 'img', - 'input', - 'ins', - 'kbd', - 'li', - 'main', - 'ol', - 'p', - 'pre', - 'span', - 'strike', - 'strong', - 'sub', - 'summary', - 'sup', - 'table', - 'tbody', - 'td', - 'th', - 'thead', - 'tr', - 'u', - 'ul', - ], - filter: ({ tag, attrs }): boolean => { - if (tag === 'iframe') { - return /^https?:\/\/(www\.)?(youtube|youtube-nocookie)\.com\/embed\/[a-zA-Z0-9_]{11}(\?)?(&modestbranding=1)?(&autoplay=0)?(&loop=1)?(&playlist=[a-zA-Z0-9_]{11})?(&rel=0)?$/.test( - attrs.src || '' - ); - } else if (['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)) { - return attrs.id !== 'svelte'; - } else if (tag === 'input') { - return attrs.type === 'checkbox' && attrs.disabled === ''; - } else if (tag === 'code' || tag === 'span') { - return !attrs.class || attrs.class.replace(' ', '').startsWith('hljs'); - } else { - return true; - } - }, - transformText: null, - }); + return insane(html, { + allowedAttributes: { + a: ['href', 'name', 'target', 'title', 'rel'], + iframe: ['allowfullscreen', 'src', 'width', 'height'], + img: ['src', 'width', 'height', 'alt'], + h1: ['id'], + h2: ['id'], + h3: ['id'], + h4: ['id'], + h5: ['id'], + h6: ['id'], + code: ['class'], + span: ['class'], + input: ['type', 'checked', 'disabled'], + font: ['color'], + }, + allowedClasses: {}, + allowedSchemes: ['http', 'https', 'mailto'], + allowedTags: [ + 'a', + 'b', + 'blockquote', + 'br', + 'caption', + 'center', + 'code', + 'del', + 'details', + 'div', + 'em', + 'font', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'hr', + 'i', + 'iframe', + 'img', + 'input', + 'ins', + 'kbd', + 'li', + 'main', + 'ol', + 'p', + 'pre', + 'span', + 'strike', + 'strong', + 'sub', + 'summary', + 'sup', + 'table', + 'tbody', + 'td', + 'th', + 'thead', + 'tr', + 'u', + 'ul', + ], + filter: ({ tag, attrs }): boolean => { + if (tag === 'iframe') { + return /^https?:\/\/(www\.)?(youtube|youtube-nocookie)\.com\/embed\/[a-zA-Z0-9_]{11}(\?)?(&modestbranding=1)?(&autoplay=0)?(&loop=1)?(&playlist=[a-zA-Z0-9_]{11})?(&rel=0)?$/.test( + attrs.src || '' + ); + } else if (['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)) { + return attrs.id !== 'svelte'; + } else if (tag === 'input') { + return attrs.type === 'checkbox' && attrs.disabled === ''; + } else if (tag === 'code' || tag === 'span') { + return !attrs.class || attrs.class.replace(' ', '').startsWith('hljs'); + } else { + return true; + } + }, + transformText: null, + }); } export function markdown(markdown: string): string { - return marked.parse(markdown); + return marked.parse(markdown); } export function markdownInline(markdown: string): string { - return marked.parseInline(markdown); + return marked.parseInline(markdown); } export function markdownXSS(markdown: string): string { - return sanitize(marked.parse(markdown)); + return sanitize(marked.parse(markdown)); } diff --git a/src/package/utils/permissions.ts b/src/package/utils/permissions.ts index 949f4849d..a91193cd6 100644 --- a/src/package/utils/permissions.ts +++ b/src/package/utils/permissions.ts @@ -1,38 +1,38 @@ export class Permissions { - data = { - uploadVersions: false, - deleteVersion: false, - editDetails: false, - editBody: false, - manageInvites: false, - removeMember: false, - editMember: false, - deleteProject: false, - }; + data = { + uploadVersions: false, + deleteVersion: false, + editDetails: false, + editBody: false, + manageInvites: false, + removeMember: false, + editMember: false, + deleteProject: false, + }; - get settingsPage(): boolean { - return ( - this.data.manageInvites || - this.data.removeMember || - this.data.editMember || - this.data.deleteProject - ); - } + get settingsPage(): boolean { + return ( + this.data.manageInvites || + this.data.removeMember || + this.data.editMember || + this.data.deleteProject + ); + } - constructor(from: number | 'ALL' | null) { - if (from === 'ALL' || from === 0b11111111 || from === null) { - Object.keys(this.data).forEach((v) => (this.data[v] = true)); - } else if (typeof from === 'number') { - this.data = { - uploadVersions: !!(from & (1 << 0)), - deleteVersion: !!(from & (1 << 1)), - editDetails: !!(from & (1 << 2)), - editBody: !!(from & (1 << 3)), - manageInvites: !!(from & (1 << 4)), - removeMember: !!(from & (1 << 5)), - editMember: !!(from & (1 << 6)), - deleteProject: !!(from & (1 << 7)), - }; - } - } + constructor(from: number | 'ALL' | null) { + if (from === 'ALL' || from === 0b11111111 || from === null) { + Object.keys(this.data).forEach((v) => (this.data[v] = true)); + } else if (typeof from === 'number') { + this.data = { + uploadVersions: !!(from & (1 << 0)), + deleteVersion: !!(from & (1 << 1)), + editDetails: !!(from & (1 << 2)), + editBody: !!(from & (1 << 3)), + manageInvites: !!(from & (1 << 4)), + removeMember: !!(from & (1 << 5)), + editMember: !!(from & (1 << 6)), + deleteProject: !!(from & (1 << 7)), + }; + } + } } diff --git a/src/package/utils/uniqueId.ts b/src/package/utils/uniqueId.ts index cf112ce13..6bbae24dc 100644 --- a/src/package/utils/uniqueId.ts +++ b/src/package/utils/uniqueId.ts @@ -3,4 +3,4 @@ let idCounter = 0; export function uniqueId(prefix = ''): string { const id = ++idCounter; return prefix + id; -} \ No newline at end of file +} diff --git a/src/package/utils/versions.ts b/src/package/utils/versions.ts index 0c52b68d3..2abcfb2b0 100644 --- a/src/package/utils/versions.ts +++ b/src/package/utils/versions.ts @@ -1,84 +1,87 @@ import gameVersions from '$generated/gameVersions.json'; export function formatVersions(versionArray: string[]): string { - const allVersions = gameVersions.slice().reverse(); - const allReleases = allVersions.filter((x) => x.version_type === 'release'); + const allVersions = gameVersions.slice().reverse(); + const allReleases = allVersions.filter((x) => x.version_type === 'release'); - const intervals = []; - let currentInterval = 0; + const intervals = []; + let currentInterval = 0; - for (let i = 0; i < versionArray.length; i++) { - const index = allVersions.findIndex((x) => x.version === versionArray[i]); - const releaseIndex = allReleases.findIndex((x) => x.version === versionArray[i]); + for (let i = 0; i < versionArray.length; i++) { + const index = allVersions.findIndex((x) => x.version === versionArray[i]); + const releaseIndex = allReleases.findIndex((x) => x.version === versionArray[i]); - if (i === 0) { - intervals.push([[versionArray[i], index, releaseIndex]]); - } else { - const intervalBase = intervals[currentInterval]; + if (i === 0) { + intervals.push([[versionArray[i], index, releaseIndex]]); + } else { + const intervalBase = intervals[currentInterval]; - if ( - (index - intervalBase[intervalBase.length - 1][1] === 1 || - releaseIndex - intervalBase[intervalBase.length - 1][2] === 1) && - (allVersions[intervalBase[0][1]].version_type === 'release' || - allVersions[index].version_type !== 'release') - ) { - intervalBase[1] = [versionArray[i], index, releaseIndex]; - } else { - currentInterval += 1; - intervals[currentInterval] = [[versionArray[i], index, releaseIndex]]; - } - } - } + if ( + (index - intervalBase[intervalBase.length - 1][1] === 1 || + releaseIndex - intervalBase[intervalBase.length - 1][2] === 1) && + (allVersions[intervalBase[0][1]].version_type === 'release' || + allVersions[index].version_type !== 'release') + ) { + intervalBase[1] = [versionArray[i], index, releaseIndex]; + } else { + currentInterval += 1; + intervals[currentInterval] = [[versionArray[i], index, releaseIndex]]; + } + } + } - const newIntervals = []; - for (let i = 0; i < intervals.length; i++) { - const interval = intervals[i]; + const newIntervals = []; + for (let i = 0; i < intervals.length; i++) { + const interval = intervals[i]; - if (interval.length === 2 && interval[0][2] !== -1 && interval[1][2] === -1) { - let lastSnapshot = null; - for (let j = interval[1][1]; j > interval[0][1]; j--) { - if (allVersions[j].version_type === 'release') { - newIntervals.push([ - interval[0], - [ - allVersions[j].version, - j, - allReleases.findIndex((x) => x.version === allVersions[j].version), - ], - ]); + if (interval.length === 2 && interval[0][2] !== -1 && interval[1][2] === -1) { + let lastSnapshot = null; + for (let j = interval[1][1]; j > interval[0][1]; j--) { + if (allVersions[j].version_type === 'release') { + newIntervals.push([ + interval[0], + [ + allVersions[j].version, + j, + allReleases.findIndex((x) => x.version === allVersions[j].version), + ], + ]); - if (lastSnapshot !== null && lastSnapshot !== j + 1) { - newIntervals.push([[allVersions[lastSnapshot].version, lastSnapshot, -1], interval[1]]); - } else { - newIntervals.push([interval[1]]); - } + if (lastSnapshot !== null && lastSnapshot !== j + 1) { + newIntervals.push([ + [allVersions[lastSnapshot].version, lastSnapshot, -1], + interval[1], + ]); + } else { + newIntervals.push([interval[1]]); + } - break; - } else { - lastSnapshot = j; - } - } - } else { - newIntervals.push(interval); - } - } + break; + } else { + lastSnapshot = j; + } + } + } else { + newIntervals.push(interval); + } + } - const output = []; + const output = []; - for (const interval of newIntervals) { - if (interval.length === 2) { - output.push(`${interval[0][0]}—${interval[1][0]}`); - } else { - output.push(interval[0][0]); - } - } + for (const interval of newIntervals) { + if (interval.length === 2) { + output.push(`${interval[0][0]}—${interval[1][0]}`); + } else { + output.push(interval[0][0]); + } + } - return output.join(', '); + return output.join(', '); } export const getPrimary = (files: Version['files']) => - files.find((file) => file.primary) || files[0]; + files.find((file) => file.primary) || files[0]; export function downloadUrl(file): string { - return import.meta.env.VITE_API_URL + `version_file/${file?.hashes.sha1}/download`; + return import.meta.env.VITE_API_URL + `version_file/${file?.hashes.sha1}/download`; } diff --git a/src/routes/_internal/components/Sidebar.svelte b/src/routes/_internal/components/Sidebar.svelte index f852d8144..ffa687025 100644 --- a/src/routes/_internal/components/Sidebar.svelte +++ b/src/routes/_internal/components/Sidebar.svelte @@ -28,6 +28,7 @@ import { page } from '$app/stores'; Writing CSS Illustrations Built-in utilities + Generator plugin
diff --git a/src/routes/_internal/styles/gh-markdown.postcss b/src/routes/_internal/styles/gh-markdown.postcss index 8d188c995..48bcc869a 100644 --- a/src/routes/_internal/styles/gh-markdown.postcss +++ b/src/routes/_internal/styles/gh-markdown.postcss @@ -27,12 +27,14 @@ position: relative; } - &:where(h2:first-child, h1:first-child, h1:first-child + h2, h3:first-child, h4:first-child, h5:first-child, h6:first-child) { + &:where(h2:first-child, h1:first-child, h1:first-child + + h2, h3:first-child, h4:first-child, h5:first-child, h6:first-child) { margin-top: 0; padding-top: 0; } - &:where(h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, h5:hover a.anchor, h6:hover a.anchor) { + &:where(h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, h5:hover + a.anchor, h6:hover a.anchor) { text-decoration: none; } @@ -119,12 +121,14 @@ padding-top: 0; } - &:where(body > h3:first-child, body > h4:first-child, body > h5:first-child, body > h6:first-child) { + &:where(body > h3:first-child, body > h4:first-child, body > h5:first-child, body + > h6:first-child) { margin-top: 0; padding-top: 0; } - &:where(a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6) { + &:where(a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child + h5, a:first-child h6) { margin-top: 0; padding-top: 0; } @@ -383,4 +387,4 @@ &:where(p) { line-height: 1.5; } -} \ No newline at end of file +} diff --git a/src/routes/_internal/styles/prism-one-dark.css b/src/routes/_internal/styles/prism-one-dark.css index 5514da9cf..290d8ac0e 100644 --- a/src/routes/_internal/styles/prism-one-dark.css +++ b/src/routes/_internal/styles/prism-one-dark.css @@ -28,77 +28,77 @@ * --syntax-cursor-line: hsla(220, 100%, 80%, 0.04); */ -code[class*="language-"], -pre[class*="language-"] { - background: hsl(220, 13%, 18%); - color: hsl(220, 14%, 71%); - text-shadow: 0 1px rgba(0, 0, 0, 0.3); - font-family: "Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace; - direction: ltr; - text-align: left; - white-space: pre; - word-spacing: normal; - word-break: normal; - line-height: 1.5; - -moz-tab-size: 2; - -o-tab-size: 2; - tab-size: 2; - -webkit-hyphens: none; - -moz-hyphens: none; - -ms-hyphens: none; - hyphens: none; +code[class*='language-'], +pre[class*='language-'] { + background: hsl(220, 13%, 18%); + color: hsl(220, 14%, 71%); + text-shadow: 0 1px rgba(0, 0, 0, 0.3); + font-family: 'Fira Code', 'Fira Mono', Menlo, Consolas, 'DejaVu Sans Mono', monospace; + direction: ltr; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + line-height: 1.5; + -moz-tab-size: 2; + -o-tab-size: 2; + tab-size: 2; + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; } /* Selection */ -code[class*="language-"]::-moz-selection, -code[class*="language-"] *::-moz-selection, -pre[class*="language-"] *::-moz-selection { - background: hsl(220, 13%, 28%); - color: inherit; - text-shadow: none; +code[class*='language-']::-moz-selection, +code[class*='language-'] *::-moz-selection, +pre[class*='language-'] *::-moz-selection { + background: hsl(220, 13%, 28%); + color: inherit; + text-shadow: none; } -code[class*="language-"]::selection, -code[class*="language-"] *::selection, -pre[class*="language-"] *::selection { - background: hsl(220, 13%, 28%); - color: inherit; - text-shadow: none; +code[class*='language-']::selection, +code[class*='language-'] *::selection, +pre[class*='language-'] *::selection { + background: hsl(220, 13%, 28%); + color: inherit; + text-shadow: none; } /* Code blocks */ -pre[class*="language-"] { - padding: 16px; - margin: 0.5em 0; - overflow: auto; - border-radius: var(--rounded); +pre[class*='language-'] { + padding: 16px; + margin: 0.5em 0; + overflow: auto; + border-radius: var(--rounded); } /* Inline code */ -:not(pre) > code[class*="language-"] { - padding: 0.2em 0.3em; - border-radius: 0.3em; - white-space: normal; +:not(pre) > code[class*='language-'] { + padding: 0.2em 0.3em; + border-radius: 0.3em; + white-space: normal; } /* Print */ @media print { - code[class*="language-"], - pre[class*="language-"] { - text-shadow: none; - } + code[class*='language-'], + pre[class*='language-'] { + text-shadow: none; + } } .token.comment, .token.prolog, .token.cdata { - color: hsl(220, 10%, 40%); + color: hsl(220, 10%, 40%); } .token.doctype, .token.punctuation, .token.entity { - color: hsl(220, 14%, 71%); + color: hsl(220, 14%, 71%); } .token.attr-name, @@ -107,11 +107,11 @@ pre[class*="language-"] { .token.constant, .token.number, .token.atrule { - color: hsl(29, 54%, 61%); + color: hsl(29, 54%, 61%); } .token.keyword { - color: hsl(286, 60%, 67%); + color: hsl(286, 60%, 67%); } .token.property, @@ -119,8 +119,8 @@ pre[class*="language-"] { .token.symbol, .token.deleted, .token.important { - color: hsl(355, 65%, 65%) !important; - display: unset; + color: hsl(355, 65%, 65%) !important; + display: unset; } .token.selector, @@ -131,123 +131,126 @@ pre[class*="language-"] { .token.regex, .token.attr-value, .token.attr-value > .token.punctuation { - color: hsl(95, 38%, 62%); + color: hsl(95, 38%, 62%); } .token.variable, .token.operator, .token.function { - color: hsl(207, 82%, 66%); + color: hsl(207, 82%, 66%); } .token.url { - color: hsl(187, 47%, 55%); + color: hsl(187, 47%, 55%); } /* HTML overrides */ .token.attr-value > .token.punctuation.attr-equals, .token.special-attr > .token.attr-value > .token.value.css { - color: hsl(220, 14%, 71%); + color: hsl(220, 14%, 71%); } /* CSS overrides */ .language-css .token.selector { - color: hsl(355, 65%, 65%); + color: hsl(355, 65%, 65%); } .language-css .token.property { - color: hsl(220, 14%, 71%); + color: hsl(220, 14%, 71%); } .language-css .token.function, .language-css .token.url > .token.function { - color: hsl(187, 47%, 55%); + color: hsl(187, 47%, 55%); } .language-css .token.url > .token.string.url { - color: hsl(95, 38%, 62%); + color: hsl(95, 38%, 62%); } .language-css .token.important, .language-css .token.atrule .token.rule { - color: hsl(286, 60%, 67%); + color: hsl(286, 60%, 67%); } /* JS overrides */ .language-javascript .token.operator { - color: hsl(286, 60%, 67%); + color: hsl(286, 60%, 67%); } -.language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation { - color: hsl(5, 48%, 51%); +.language-javascript + .token.template-string + > .token.interpolation + > .token.interpolation-punctuation.punctuation { + color: hsl(5, 48%, 51%); } /* JSON overrides */ .language-json .token.operator { - color: hsl(220, 14%, 71%); + color: hsl(220, 14%, 71%); } .language-json .token.null.keyword { - color: hsl(29, 54%, 61%); + color: hsl(29, 54%, 61%); } /* MD overrides */ .language-markdown .token.url, .language-markdown .token.url > .token.operator, .language-markdown .token.url-reference.url > .token.string { - color: hsl(220, 14%, 71%); + color: hsl(220, 14%, 71%); } .language-markdown .token.url > .token.content { - color: hsl(207, 82%, 66%); + color: hsl(207, 82%, 66%); } .language-markdown .token.url > .token.url, .language-markdown .token.url-reference.url { - color: hsl(187, 47%, 55%); + color: hsl(187, 47%, 55%); } .language-markdown .token.blockquote.punctuation, .language-markdown .token.hr.punctuation { - color: hsl(220, 10%, 40%); - font-style: italic; + color: hsl(220, 10%, 40%); + font-style: italic; } .language-markdown .token.code-snippet { - color: hsl(95, 38%, 62%); + color: hsl(95, 38%, 62%); } .language-markdown .token.bold .token.content { - color: hsl(29, 54%, 61%); + color: hsl(29, 54%, 61%); } .language-markdown .token.italic .token.content { - color: hsl(286, 60%, 67%); + color: hsl(286, 60%, 67%); } .language-markdown .token.strike .token.content, .language-markdown .token.strike .token.punctuation, .language-markdown .token.list.punctuation, .language-markdown .token.title.important > .token.punctuation { - color: hsl(355, 65%, 65%); + color: hsl(355, 65%, 65%); } /* General */ .token.bold { - font-weight: bold; + font-weight: bold; } .token.comment, .token.italic { - font-style: italic; + font-style: italic; } .token.entity { - cursor: help; + cursor: help; } .token.namespace { - opacity: 0.8; + opacity: 0.8; } /* Plugin overrides */ @@ -258,24 +261,24 @@ pre[class*="language-"] { .token.token.cr:before, .token.token.lf:before, .token.token.space:before { - color: hsla(220, 14%, 71%, 0.15); - text-shadow: none; + color: hsla(220, 14%, 71%, 0.15); + text-shadow: none; } /* Toolbar plugin overrides */ /* Space out all buttons and move them away from the right edge of the code block */ div.code-toolbar > .toolbar.toolbar > .toolbar-item { - margin-right: 0.4em; + margin-right: 0.4em; } /* Styling the buttons */ div.code-toolbar > .toolbar.toolbar > .toolbar-item > button, div.code-toolbar > .toolbar.toolbar > .toolbar-item > a, div.code-toolbar > .toolbar.toolbar > .toolbar-item > span { - background: hsl(220, 13%, 26%); - color: hsl(220, 9%, 55%); - padding: 0.1em 0.4em; - border-radius: 0.3em; + background: hsl(220, 13%, 26%); + color: hsl(220, 9%, 55%); + padding: 0.1em 0.4em; + border-radius: 0.3em; } div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover, @@ -284,43 +287,43 @@ div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover, div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus, div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover, div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus { - background: hsl(220, 13%, 28%); - color: hsl(220, 14%, 71%); + background: hsl(220, 13%, 28%); + color: hsl(220, 14%, 71%); } /* Line Highlight plugin overrides */ /* The highlighted line itself */ .line-highlight.line-highlight { - background: hsla(220, 100%, 80%, 0.04); + background: hsla(220, 100%, 80%, 0.04); } /* Default line numbers in Line Highlight plugin */ .line-highlight.line-highlight:before, .line-highlight.line-highlight[data-end]:after { - background: hsl(220, 13%, 26%); - color: hsl(220, 14%, 71%); - padding: 0.1em 0.6em; - border-radius: 0.3em; - box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.2); /* same as Toolbar plugin default */ + background: hsl(220, 13%, 26%); + color: hsl(220, 14%, 71%); + padding: 0.1em 0.6em; + border-radius: 0.3em; + box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.2); /* same as Toolbar plugin default */ } /* Hovering over a linkable line number (in the gutter area) */ /* Requires Line Numbers plugin as well */ pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before { - background-color: hsla(220, 100%, 80%, 0.04); + background-color: hsla(220, 100%, 80%, 0.04); } /* Line Numbers and Command Line plugins overrides */ /* Line separating gutter from coding area */ .line-numbers.line-numbers .line-numbers-rows, .command-line .command-line-prompt { - border-right-color: hsla(220, 14%, 71%, 0.15); + border-right-color: hsla(220, 14%, 71%, 0.15); } /* Stuff in the gutter */ .line-numbers .line-numbers-rows > span:before, .command-line .command-line-prompt > span:before { - color: hsl(220, 14%, 45%); + color: hsl(220, 14%, 45%); } /* Match Braces plugin overrides */ @@ -328,65 +331,65 @@ pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > spa .rainbow-braces .token.token.punctuation.brace-level-1, .rainbow-braces .token.token.punctuation.brace-level-5, .rainbow-braces .token.token.punctuation.brace-level-9 { - color: hsl(355, 65%, 65%); + color: hsl(355, 65%, 65%); } .rainbow-braces .token.token.punctuation.brace-level-2, .rainbow-braces .token.token.punctuation.brace-level-6, .rainbow-braces .token.token.punctuation.brace-level-10 { - color: hsl(95, 38%, 62%); + color: hsl(95, 38%, 62%); } .rainbow-braces .token.token.punctuation.brace-level-3, .rainbow-braces .token.token.punctuation.brace-level-7, .rainbow-braces .token.token.punctuation.brace-level-11 { - color: hsl(207, 82%, 66%); + color: hsl(207, 82%, 66%); } .rainbow-braces .token.token.punctuation.brace-level-4, .rainbow-braces .token.token.punctuation.brace-level-8, .rainbow-braces .token.token.punctuation.brace-level-12 { - color: hsl(286, 60%, 67%); + color: hsl(286, 60%, 67%); } /* Diff Highlight plugin overrides */ /* Taken from https://github.com/atom/github/blob/master/styles/variables.less */ pre.diff-highlight > code .token.token.deleted:not(.prefix), pre > code.diff-highlight .token.token.deleted:not(.prefix) { - background-color: hsla(353, 100%, 66%, 0.15); + background-color: hsla(353, 100%, 66%, 0.15); } pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection, pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection, pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection, pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection { - background-color: hsla(353, 95%, 66%, 0.25); + background-color: hsla(353, 95%, 66%, 0.25); } pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection, pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection, pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection, pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection { - background-color: hsla(353, 95%, 66%, 0.25); + background-color: hsla(353, 95%, 66%, 0.25); } pre.diff-highlight > code .token.token.inserted:not(.prefix), pre > code.diff-highlight .token.token.inserted:not(.prefix) { - background-color: hsla(137, 100%, 55%, 0.15); + background-color: hsla(137, 100%, 55%, 0.15); } pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection, pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection, pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection, pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection { - background-color: hsla(135, 73%, 55%, 0.25); + background-color: hsla(135, 73%, 55%, 0.25); } pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection, pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection, pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection, pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection { - background-color: hsla(135, 73%, 55%, 0.25); + background-color: hsla(135, 73%, 55%, 0.25); } /* Previewers plugin overrides */ @@ -394,48 +397,48 @@ pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection { /* Border around popup */ .prism-previewer.prism-previewer:before, .prism-previewer-gradient.prism-previewer-gradient div { - border-color: hsl(224, 13%, 17%); + border-color: hsl(224, 13%, 17%); } /* Angle and time should remain as circles and are hence not included */ .prism-previewer-color.prism-previewer-color:before, .prism-previewer-gradient.prism-previewer-gradient div, .prism-previewer-easing.prism-previewer-easing:before { - border-radius: 0.3em; + border-radius: 0.3em; } /* Triangles pointing to the code */ .prism-previewer.prism-previewer:after { - border-top-color: hsl(224, 13%, 17%); + border-top-color: hsl(224, 13%, 17%); } .prism-previewer-flipped.prism-previewer-flipped.after { - border-bottom-color: hsl(224, 13%, 17%); + border-bottom-color: hsl(224, 13%, 17%); } /* Background colour within the popup */ .prism-previewer-angle.prism-previewer-angle:before, .prism-previewer-time.prism-previewer-time:before, .prism-previewer-easing.prism-previewer-easing { - background: hsl(219, 13%, 22%); + background: hsl(219, 13%, 22%); } /* For angle, this is the positive area (eg. 90deg will display one quadrant in this colour) */ /* For time, this is the alternate colour */ .prism-previewer-angle.prism-previewer-angle circle, .prism-previewer-time.prism-previewer-time circle { - stroke: hsl(220, 14%, 71%); - stroke-opacity: 1; + stroke: hsl(220, 14%, 71%); + stroke-opacity: 1; } /* Stroke colours of the handle, direction point, and vector itself */ .prism-previewer-easing.prism-previewer-easing circle, .prism-previewer-easing.prism-previewer-easing path, .prism-previewer-easing.prism-previewer-easing line { - stroke: hsl(220, 14%, 71%); + stroke: hsl(220, 14%, 71%); } /* Fill colour of the handle */ .prism-previewer-easing.prism-previewer-easing circle { - fill: transparent; + fill: transparent; } diff --git a/src/routes/classes/InfoTable.md b/src/routes/classes/InfoTable.md index a0674a5d6..f873e9679 100644 --- a/src/routes/classes/InfoTable.md +++ b/src/routes/classes/InfoTable.md @@ -7,4 +7,4 @@ Visibilty Approved
-``` \ No newline at end of file +``` diff --git a/src/routes/classes/Link.md b/src/routes/classes/Link.md index 79c2f21db..99267115f 100644 --- a/src/routes/classes/Link.md +++ b/src/routes/classes/Link.md @@ -19,4 +19,4 @@ Source Wiki -``` \ No newline at end of file +``` diff --git a/src/routes/components/Badge.md b/src/routes/components/Badge.md index 55830e4a4..dfb200480 100644 --- a/src/routes/components/Badge.md +++ b/src/routes/components/Badge.md @@ -7,4 +7,4 @@ -``` \ No newline at end of file +``` diff --git a/src/routes/components/CheckboxList.md b/src/routes/components/CheckboxList.md index c859dab32..8c069563c 100644 --- a/src/routes/components/CheckboxList.md +++ b/src/routes/components/CheckboxList.md @@ -4,11 +4,11 @@ import IconSquare from 'virtual:icons/lucide/square' import IconCircle from 'virtual:icons/lucide/circle' import IconTriangle from 'virtual:icons/lucide/triangle' - + let selected = [] - Selected: {selected} diff --git a/src/routes/components/CheckboxVirtualList.md b/src/routes/components/CheckboxVirtualList.md index 28c4e9a19..fa6eb73ab 100644 --- a/src/routes/components/CheckboxVirtualList.md +++ b/src/routes/components/CheckboxVirtualList.md @@ -3,18 +3,18 @@ import { CheckboxVirtualList } from "omorphia"; import IconStar from 'virtual:icons/heroicons-outline/star' import { uniqueId } from 'omorphia/utils/uniqueId' - + let options = Array(100).fill({}) .map(option => ({ label: 'Star-' + uniqueId(), icon: IconStar, value: uniqueId(), })) - + let selected = ['2', '6'] - diff --git a/src/routes/components/Chips.md b/src/routes/components/Chips.md index 92323c872..d3f196f8a 100644 --- a/src/routes/components/Chips.md +++ b/src/routes/components/Chips.md @@ -17,7 +17,6 @@ /> ``` - ### Force an option to be selected with `neverEmpty` ```svelte example raised diff --git a/src/routes/components/NavRow.md b/src/routes/components/NavRow.md index a456ce6d2..8840406f7 100644 --- a/src/routes/components/NavRow.md +++ b/src/routes/components/NavRow.md @@ -23,4 +23,4 @@ ]}> Click for fun -``` \ No newline at end of file +``` diff --git a/src/routes/components/Pagination.md b/src/routes/components/Pagination.md index d6655dae1..11096acad 100644 --- a/src/routes/components/Pagination.md +++ b/src/routes/components/Pagination.md @@ -6,4 +6,4 @@ Use pagination to show a set of page numbers and navigation directions to move t -``` \ No newline at end of file +``` diff --git a/src/routes/components/Select.md b/src/routes/components/Select.md index 2beecfcb1..b044809dc 100644 --- a/src/routes/components/Select.md +++ b/src/routes/components/Select.md @@ -1,19 +1,19 @@ ```svelte example raised