diff --git a/designs/examples/src/index.mjs b/designs/examples/src/index.mjs index cb9b238c809..fad49746d12 100644 --- a/designs/examples/src/index.mjs +++ b/designs/examples/src/index.mjs @@ -3,9 +3,6 @@ import { pluginBundle } from '@freesewing/plugin-bundle' import { gorePlugin } from '@freesewing/plugin-gore' import { data } from '../data.mjs' -// Snippet API -import { snippet, snippet_attr, snippet_clone } from './snippet.mjs' - // Stacks import { stacks_top, diff --git a/designs/ursula/src/elastic.mjs b/designs/ursula/src/elastic.mjs index c7c33eb552d..3db5aa15f41 100644 --- a/designs/ursula/src/elastic.mjs +++ b/designs/ursula/src/elastic.mjs @@ -1,19 +1,6 @@ import { gusset } from './gusset.mjs' -function ursulaElastic({ - options, - Point, - points, - Path, - paths, - store, - utils, - units, - sa, - paperless, - macro, - part, -}) { +function ursulaElastic({ options, Point, points, Path, paths, store, utils, units, sa, part }) { // Stretch utility method store.set('elasticScale', utils.stretchToScale(options.elasticStretch)) @@ -35,10 +22,10 @@ function ursulaElastic({ // Draw a box around the text, so the part shows up correctly. paths.box = new Path() - .move(new Point(-10,-10)) - .line(new Point(-10,15)) - .line(new Point(200,15)) - .line(new Point(200,-10)) + .move(new Point(-10, -10)) + .line(new Point(-10, 15)) + .line(new Point(200, 15)) + .line(new Point(200, -10)) .close() .setClass('hidden') diff --git a/packages/rehype-highlight-lines/src/index.mjs b/packages/rehype-highlight-lines/src/index.mjs index a60629f4267..da71c8bfb0b 100644 --- a/packages/rehype-highlight-lines/src/index.mjs +++ b/packages/rehype-highlight-lines/src/index.mjs @@ -21,7 +21,7 @@ export default (userOptions = {}) => { ...userOptions, } - const splitParams = (node, i, parent) => { + const splitParams = (node) => { if (node.children.length === 1 && node.children[0].type === 'text') { const content = node.children[0].value.split('\n') node.children = content.map((value) => @@ -42,7 +42,6 @@ export default (userOptions = {}) => { // Keep track of whether we've opened a highlight block let isOpen = 0 let children = {} - let variant // Detect opening or closing comment const isOpeningOrClosingComment = (node) => { @@ -64,12 +63,6 @@ export default (userOptions = {}) => { return [false, 'highlight'] } - // Detect opening comment - const isOpeningComment = (node) => - node.tagName === options.commentTag && node.properties?.className === options.commentClass - ? true - : false - // Visitor method const visitor = (node, i, parent) => { const [type, variant] = isOpeningOrClosingComment(node) diff --git a/sites/dev/components/header.js b/sites/dev/components/header.js index 80a0b9e1e20..c2d9b472c28 100644 --- a/sites/dev/components/header.js +++ b/sites/dev/components/header.js @@ -1,12 +1,8 @@ import { useState, useEffect } from 'react' -import FreeSewingIcon from 'shared/components/icons/freesewing.js' -import Link from 'next/link' import ThemePicker from 'shared/components/theme-picker.js' import CloseIcon from 'shared/components/icons/close.js' import MenuIcon from 'shared/components/icons/menu.js' import SearchIcon from 'shared/components/icons/search.js' -import SwipeRightIcon from 'shared/components/icons/swiperight.js' -import SwipeLeftIcon from 'shared/components/icons/swipeleft.js' import Ribbon from 'shared/components/ribbon.js' import { WordMark } from 'shared/components/wordmark.js' diff --git a/sites/dev/components/help-us.js b/sites/dev/components/help-us.js index 5214eb02a06..043e3b40f05 100644 --- a/sites/dev/components/help-us.js +++ b/sites/dev/components/help-us.js @@ -1,6 +1,6 @@ import Popout from 'shared/components/popout.js' -const HelpUs = ({ mdx = false, slug = '/' }) => ( +const HelpUs = ({ slug = '/' }) => (
Click here to learn how you can help us improve this page diff --git a/sites/dev/components/layouts/docs.js b/sites/dev/components/layouts/docs.js index abb2c6f8db2..3c40496a409 100644 --- a/sites/dev/components/layouts/docs.js +++ b/sites/dev/components/layouts/docs.js @@ -18,7 +18,7 @@ const DefaultLayout = ({ app, title = false, crumbs = false, children = [] }) => app={app} slug={slug} before={[ -
+
diff --git a/sites/dev/components/navigation/primary.js b/sites/dev/components/navigation/primary.js index de156dcb0d6..47411fb0496 100644 --- a/sites/dev/components/navigation/primary.js +++ b/sites/dev/components/navigation/primary.js @@ -204,9 +204,7 @@ const Navigation = ({ app, active, className='' }) => { */ export const Icons = ({ app, - active, ulClasses = '', - liClasses = '', linkClasses = `grow text-lg lg:text-xl py-1 text-base-content sm:text-base-content hover:text-secondary sm:hover:text-secondary hover:cursor-pointer flex flex-col items-center`, @@ -242,7 +240,6 @@ const PrimaryMenu = ({ app, active, before=[], after=[] }) => ( export const MainSections = ({ app, active }) => { if (!app.navigation) return null const output = [] - let last for (const page of order(app.navigation)) { const act = isActive(page.__slug, active) const txt = ( diff --git a/sites/dev/components/wrappers/page.js b/sites/dev/components/wrappers/page.js index 6cde52604ea..08d7ff02152 100644 --- a/sites/dev/components/wrappers/page.js +++ b/sites/dev/components/wrappers/page.js @@ -27,7 +27,7 @@ const PageWrapper = ({ const router = useRouter() const slug = router.asPath.slice(1) - useEffect(() => app.setSlug(slug), [slug]) + useEffect(() => app.setSlug(slug), [slug, app]) // Trigger search with Ctrl+k useHotkeys('ctrl+k', (evt) => { diff --git a/sites/dev/pages/404.js b/sites/dev/pages/404.js index b254c21e88c..d2030d138e6 100644 --- a/sites/dev/pages/404.js +++ b/sites/dev/pages/404.js @@ -6,7 +6,7 @@ import Robot from 'shared/components/robot' import Popout from 'shared/components/popout' import PageLink from 'shared/components/page-link' -const Page404 = (props) => { +const Page404 = () => { const app = useApp() return ( diff --git a/sites/dev/pages/contact.js b/sites/dev/pages/contact.js index 9774135d14e..530559d4a70 100644 --- a/sites/dev/pages/contact.js +++ b/sites/dev/pages/contact.js @@ -16,7 +16,7 @@ const No = () => ( ) -const ContactPage = (props) => { +const ContactPage = () => { const app = useApp() const title = 'Contact information' diff --git a/sites/dev/pages/index.js b/sites/dev/pages/index.js index 8ceb433f7d0..9350335541f 100644 --- a/sites/dev/pages/index.js +++ b/sites/dev/pages/index.js @@ -7,7 +7,6 @@ import { Icons } from 'shared/components/navigation/primary' import Highlight from 'shared/components/mdx/highlight' import Popout from 'shared/components/popout' import WebLink from 'shared/components/web-link' -import Code from 'shared/components/code' import PageLink from 'shared/components/page-link' const HomePage = () => { @@ -113,7 +112,10 @@ const HomePage = () => {

What's changed?

Check{' '} - {' '} + {' '} to learn about what is new in version 3 of FreeSewing, and what changes you should make in your own designs to port them to version 3.

diff --git a/sites/org/components/header.js b/sites/org/components/header.js index 23a46b8f373..0b2af17fe4e 100644 --- a/sites/org/components/header.js +++ b/sites/org/components/header.js @@ -1,5 +1,4 @@ import { useState, useEffect } from 'react' -import Link from 'next/link' import ThemePicker from 'shared/components/theme-picker.js' import LocalePicker from 'shared/components/locale-picker.js' import CloseIcon from 'shared/components/icons/close.js' diff --git a/sites/org/components/help-us.js b/sites/org/components/help-us.js index 772a9c3c829..4a8e7e2fb11 100644 --- a/sites/org/components/help-us.js +++ b/sites/org/components/help-us.js @@ -1,44 +1,52 @@ import Popout from 'shared/components/popout.js' -const HelpUs = ({ mdx=false, slug='/' }) => ( +const HelpUs = ({ mdx = false, slug = '/' }) => (
Click here to learn how you can help us improve this page {mdx && ( - +
Found a mistake?
- You can
edit this page on Github and help us improve our documentation. + > + edit this page on Github + {' '} + and help us improve our documentation. )} - +
Does this look ok?
auto-generated banner

- If it looks ok, great! But if not, please let me know about it. - Either by + If it looks ok, great! But if not, please let me know about it. Either by{' '} + reaching out on Discord - or feel free to {' '} + or feel free to{' '} + create - an issue on Github. + > + create an issue on Github + + .

Why do you ask?

- I recently added a backend endpoint to auto-generate pretty (I hope) Open Graph images. - They are those little preview images you see when you paste a link in Discord (for example). + I recently added a backend endpoint to auto-generate pretty (I hope) Open Graph images. They + are those little preview images you see when you paste a link in Discord (for example).

This idea is that it will auto-generate an image, but I am certain there are some edge cases - where that will not work. - There are hundreds of pages on this website and checking them all one by one is not something - I see myself doing. But since you are here on this page, perhaps you could see if the image - above looks ok. + where that will not work. There are hundreds of pages on this website and checking them all + one by one is not something I see myself doing. But since you are here on this page, perhaps + you could see if the image above looks ok.

Thank you, I really appreciate your help with this.

@@ -46,4 +54,3 @@ const HelpUs = ({ mdx=false, slug='/' }) => ( ) export default HelpUs - diff --git a/sites/org/components/layouts/bare.js b/sites/org/components/layouts/bare.js index bdadd65b9f2..b46e4fe6774 100644 --- a/sites/org/components/layouts/bare.js +++ b/sites/org/components/layouts/bare.js @@ -2,7 +2,7 @@ import { useRouter } from 'next/router' import Aside from 'shared/components/navigation/aside' import ThemePicker from 'shared/components/theme-picker' -const DefaultLayout = ({ app, title=false, children=[] }) => { +const DefaultLayout = ({ app, children = [] }) => { const router = useRouter() const slug = router.asPath.slice(1) diff --git a/sites/org/components/wrappers/layout.js b/sites/org/components/wrappers/layout.js index 8015a371e59..f542205b91e 100644 --- a/sites/org/components/wrappers/layout.js +++ b/sites/org/components/wrappers/layout.js @@ -1,19 +1,9 @@ -import { useState } from 'react' import { useRouter } from 'next/router' import Header from 'site/components/header' import Footer from 'site/components/footer' import Search from 'site/components/search' -const LayoutWrapper = ({ - app, - title=false, - children=[], - search, - setSearch, - noSearch=false, - workbench=false, - AltMenu=null, -}) => { +const LayoutWrapper = ({ app, children = [], search, setSearch, noSearch = false }) => { const startNavigation = () => { app.startLoading() // Force close of menu on mobile if it is open @@ -25,29 +15,31 @@ const LayoutWrapper = ({ const router = useRouter() router.events?.on('routeChangeStart', startNavigation) router.events?.on('routeChangeComplete', () => app.stopLoading()) - const [collapsePrimaryNav, setCollapsePrimaryNav] = useState(workbench || false) - const [collapseAltMenu, setCollapseAltMenu] = useState(false) return ( -
+ `} + >
{children}
{!noSearch && search && ( <> -
- -
-
+ `} + > + +
+
)}
diff --git a/sites/org/components/wrappers/page.js b/sites/org/components/wrappers/page.js index f8bca2edf0d..5bd9534dd17 100644 --- a/sites/org/components/wrappers/page.js +++ b/sites/org/components/wrappers/page.js @@ -9,25 +9,24 @@ import Docs from 'site/components/layouts/docs' import Feeds from 'site/components/feeds.js' /* This component should wrap all page content */ -const PageWrapper= ({ - title="FIXME: No title set", - noSearch=false, - app=false, - layout=Docs, - crumbs=false, - children=[] +const PageWrapper = ({ + title = 'FIXME: No title set', + noSearch = false, + app = false, + layout = Docs, + crumbs = false, + children = [], }) => { - const swipeHandlers = useSwipeable({ - onSwipedLeft: evt => (app.primaryMenu) ? app.setPrimaryMenu(false) : null, - onSwipedRight: evt => (app.primaryMenu) ? null : app.setPrimaryMenu(true), - trackMouse: true + onSwipedLeft: () => (app.primaryMenu ? app.setPrimaryMenu(false) : null), + onSwipedRight: () => (app.primaryMenu ? null : app.setPrimaryMenu(true)), + trackMouse: true, }) const router = useRouter() const slug = router.asPath.slice(1) - useEffect(() => app.setSlug(slug), [slug]) + useEffect(() => app.setSlug(slug), [slug, app]) // Trigger search with Ctrl+k useHotkeys('ctrl+k', (evt) => { @@ -41,7 +40,9 @@ const PageWrapper= ({ app: app, title: title, crumbs: crumbs, - search, setSearch, toggleSearch: () => setSearch(!search), + search, + setSearch, + toggleSearch: () => setSearch(!search), noSearch: noSearch, } @@ -56,14 +57,10 @@ const PageWrapper= ({ > - {Layout - ? {children} - : children - } + {Layout ? {children} : children}
) } export default PageWrapper - diff --git a/sites/org/pages/blog/index.js b/sites/org/pages/blog/index.js index 43e03432010..3818ffad8af 100644 --- a/sites/org/pages/blog/index.js +++ b/sites/org/pages/blog/index.js @@ -7,45 +7,56 @@ import { strapiImage } from 'shared/utils' import { useTranslation } from 'next-i18next' import { serverSideTranslations } from 'next-i18next/serverSideTranslations' -const strapi = "https://posts.freesewing.org" +const strapi = 'https://posts.freesewing.org' const textShadow = { style: { - textShadow: "1px 1px 1px #000000, -1px -1px 1px #000000, 1px -1px 1px #000000, -1px 1px 1px #000000, 2px 2px 1px #000000" - } + textShadow: + '1px 1px 1px #000000, -1px -1px 1px #000000, 1px -1px 1px #000000, -1px 1px 1px #000000, 2px 2px 1px #000000', + }, } -const Preview = ({ app, post }) => ( +const Preview = ({ post }) => (
-
+
-
-
+
{post.title}
-
@@ -61,10 +72,11 @@ const BlogIndexPage = (props) => { const { t } = useTranslation() return ( - +
- {props.posts.map(post => ) - } + {props.posts.map((post) => ( + + ))}
) @@ -82,18 +94,15 @@ export default BlogIndexPage * * To learn more, see: https://nextjs.org/docs/basic-features/data-fetching */ -export async function getStaticProps({ params, locale }) { - - const posts = await fetch( - `${strapiHost}/blogposts?_locale=${locale}&_sort=date:DESC&dev_ne=true` - ) - .then(response => response.json()) - .then(data => data) - .catch(err => console.log(err)) +export async function getStaticProps({ locale }) { + const posts = await fetch(`${strapiHost}/blogposts?_locale=${locale}&_sort=date:DESC&dev_ne=true`) + .then((response) => response.json()) + .then((data) => data) + .catch((err) => console.log(err)) return { props: { - posts: posts.map(post => ({ + posts: posts.map((post) => ({ slug: post.slug, title: post.title, date: post.date, @@ -101,7 +110,6 @@ export async function getStaticProps({ params, locale }) { image: strapiImage(post.image, ['medium']), })), ...(await serverSideTranslations(locale)), - } + }, } } - diff --git a/sites/org/pages/community/index.js b/sites/org/pages/community/index.js index 0a36036ba8b..157ecaa4385 100644 --- a/sites/org/pages/community/index.js +++ b/sites/org/pages/community/index.js @@ -22,30 +22,32 @@ const translations = { }, } -const CommunityPage = (props) => { +const CommunityPage = () => { const app = useApp() - return ( - +
-

{translations.contributors[app.locale]}

- ({ - img: item.avatar_url, - title: item.name, - href: item.profile - }))} /> + ({ + img: item.avatar_url, + title: item.name, + href: item.profile, + }))} + />

{translations.patrons[app.locale]}

- ({ - img: item.img, - title: item.name, - slug: `/users/${item.username}` - }))} /> + ({ + img: item.img, + title: item.name, + slug: `/users/${item.username}`, + }))} + />
@@ -53,4 +55,3 @@ const CommunityPage = (props) => { } export default CommunityPage - diff --git a/sites/org/pages/designs/index.js b/sites/org/pages/designs/index.js index 26a4305329d..62b6cdc9edb 100644 --- a/sites/org/pages/designs/index.js +++ b/sites/org/pages/designs/index.js @@ -9,21 +9,17 @@ import Design from 'site/components/design.js' // Don't bother with utilities delete designs.utilities -const DesignsPage = (props) => { +const DesignsPage = () => { const app = useApp() const { t } = useTranslation() - const allDesigns = [ - ...designs.accessories, - ...designs.blocks, - ...designs.garments, - ].sort() + const allDesigns = [...designs.accessories, ...designs.blocks, ...designs.garments].sort() return (
    - {allDesigns.map(design => ( + {allDesigns.map((design) => (
  • @@ -31,7 +27,9 @@ const DesignsPage = (props) => {
- {allDesigns.map(design => )} + {allDesigns.map((design) => ( + + ))}
) @@ -43,7 +41,6 @@ export async function getStaticProps({ locale }) { return { props: { ...(await serverSideTranslations(locale)), - } + }, } } - diff --git a/sites/org/pages/docs/index.js b/sites/org/pages/docs/index.js index 72eb0aade71..c5bb00f9cae 100644 --- a/sites/org/pages/docs/index.js +++ b/sites/org/pages/docs/index.js @@ -9,7 +9,7 @@ const DocsPage = ({ title, mdx }) => { // We don't need all MDX components here, just ReadMore const components = { - ReadMore: props => , + ReadMore: (props) => , } return ( @@ -34,20 +34,14 @@ export default DocsPage * * To learn more, see: https://nextjs.org/docs/basic-features/data-fetching */ -export async function getStaticProps({ params, locale }) { - - const { mdx, frontmatter } = await mdxLoader( - locale, - 'org', - ['docs'] - ) - const { title='FIXME: Please give this page a title' } = frontmatter +export async function getStaticProps({ locale }) { + const { mdx, frontmatter } = await mdxLoader(locale, 'org', ['docs']) + const { title = 'FIXME: Please give this page a title' } = frontmatter return { props: { mdx, title, - } + }, } } - diff --git a/sites/org/pages/index.js b/sites/org/pages/index.js index c30a293cbe0..9b1309c94a1 100644 --- a/sites/org/pages/index.js +++ b/sites/org/pages/index.js @@ -8,7 +8,7 @@ import Layout from 'site/components/layouts/bare' import { Icons } from 'shared/components/navigation/primary' import DownIcon from 'shared/components/icons/down.js' -const HomePage = (props) => { +const HomePage = () => { const app = useApp() const { t } = useTranslation(['homepage', 'ograph']) @@ -16,31 +16,35 @@ const HomePage = (props) => { - - - - + + + + - - - + + + -
-
-   -
-
-

+
+   +
+
+

{ bg-primary bg-opacity-80 `} - style={{ textShadow: '1px 1px 3px #000', color: 'white' }} - > - FreeSewing - .org -

-

+ FreeSewing + .org +

+

-
{t('common:sloganCome')}
-
- {t('common:sloganStay')} -
-
-

-
- +
{t('common:sloganCome')}
+
+ {t('common:sloganStay')} +
+
+

+
+ -
-
- {t('scrollDownToLearnMore')} - -
+ linkStyle={{ + textShadow: + '2px 2px 2px #000, -2px 2px 2px #000, -2px -2px 2px #000, 2px -2px 2px #000', + }} + />
-
+
+ {t('scrollDownToLearnMore')} + +
+
+
-
- Create homepage -
-
-
- + Create homepage +
+
+
+ + /> +
-
- ) } @@ -114,7 +122,6 @@ export async function getStaticProps({ locale }) { return { props: { ...(await serverSideTranslations(locale)), - } + }, } } - diff --git a/sites/org/pages/showcase/designs/index.js b/sites/org/pages/showcase/designs/index.js index 5e9de2352a8..9dc7aab343a 100644 --- a/sites/org/pages/showcase/designs/index.js +++ b/sites/org/pages/showcase/designs/index.js @@ -18,7 +18,7 @@ const PreviewTile = ({ img, slug, title }) => ( `} > -
+
) @@ -26,21 +26,25 @@ const PreviewTile = ({ img, slug, title }) => ( const DesignPosts = ({ design, posts }) => { const { t } = useTranslation(['patterns']) return ( -
+

-
- {posts.slice(0, 10).map(post => )} + `} + > + {posts.slice(0, 10).map((post) => ( + + ))}
) @@ -58,17 +62,22 @@ const ShowcaseIndexPage = (props) => { } return ( - -
+
- {Object.keys(designs).sort().map(design => )} + `} + > + {Object.keys(designs) + .sort() + .map((design) => ( + + ))}
) @@ -86,18 +95,17 @@ export default ShowcaseIndexPage * * To learn more, see: https://nextjs.org/docs/basic-features/data-fetching */ -export async function getStaticProps({ params, locale }) { - +export async function getStaticProps({ locale }) { const posts = await fetch( `${strapiHost}/showcaseposts?_locale=${locale}&_sort=date:DESC&_limit=-1` ) - .then(response => response.json()) - .then(data => data) - .catch(err => console.log(err)) + .then((response) => response.json()) + .then((data) => data) + .catch((err) => console.log(err)) return { props: { - posts: posts.map(post => { + posts: posts.map((post) => { const designs = [post.design1] if (post.design2 && post.design2.length > 2) designs.push(post.design2) if (post.design3 && post.design3.length > 2) designs.push(post.design3) @@ -107,11 +115,10 @@ export async function getStaticProps({ params, locale }) { date: post.date, maker: post.maker.displayname, image: strapiImage(post.image, ['medium']), - designs + designs, } }), ...(await serverSideTranslations(locale)), - } + }, } } - diff --git a/sites/org/pages/showcase/index.js b/sites/org/pages/showcase/index.js index 77ed0b313cb..b96b9c3aa17 100644 --- a/sites/org/pages/showcase/index.js +++ b/sites/org/pages/showcase/index.js @@ -18,10 +18,13 @@ export const PreviewTile = ({ img, slug, title }) => ( `} > -
+ `} + title={title} + />
) @@ -29,23 +32,28 @@ export const PreviewTile = ({ img, slug, title }) => ( const DesignPosts = ({ design, posts }) => { const { t } = useTranslation(['patterns']) return ( -
+

{t(`${design}.t`)}

-
- {posts.slice(0, 10).map(post => )} + `} + style={{ maxWidth: 'calc(100vw - 3rem)' }} + > + {posts.slice(0, 10).map((post) => ( + + ))}
) @@ -64,17 +72,24 @@ const ShowcaseIndexPage = (props) => { } return ( - +
    - {Object.keys(designs).sort().map(design => ( -
  • - -
  • - ))} + {Object.keys(designs) + .sort() + .map((design) => ( +
  • + +
  • + ))}
-
{ lg:max-w-lg xl:max-w-3xl 2xl:max-w-7xl - `}> - {Object.keys(designs).sort().map(design => )} + `} + > + {Object.keys(designs) + .sort() + .map((design) => ( + + ))}
) @@ -102,18 +121,17 @@ export default ShowcaseIndexPage * * To learn more, see: https://nextjs.org/docs/basic-features/data-fetching */ -export async function getStaticProps({ params, locale }) { - +export async function getStaticProps({ locale }) { const posts = await fetch( `${strapiHost}/showcaseposts?_locale=${locale}&_sort=date:DESC&_limit=-1` ) - .then(response => response.json()) - .then(data => data) - .catch(err => console.log(err)) + .then((response) => response.json()) + .then((data) => data) + .catch((err) => console.log(err)) return { props: { - posts: posts.map(post => { + posts: posts.map((post) => { const designs = [post.design1] if (post.design2 && post.design2.length > 2) designs.push(post.design2) if (post.design3 && post.design3.length > 2) designs.push(post.design3) @@ -123,11 +141,10 @@ export async function getStaticProps({ params, locale }) { date: post.date, maker: post.maker.displayname, image: strapiImage(post.image, ['medium']), - designs + designs, } }), ...(await serverSideTranslations(locale)), - } + }, } } - diff --git a/sites/org/pages/typography.js b/sites/org/pages/typography.js index 6c3be98d910..6c0a668347e 100644 --- a/sites/org/pages/typography.js +++ b/sites/org/pages/typography.js @@ -3,41 +3,45 @@ import Page from 'site/components/wrappers/page.js' import useApp from 'site/hooks/useApp.js' import Popout from 'shared/components/popout.js' -const TypographyPage = (props) => { +const TypographyPage = () => { const app = useApp() const { updateNavigation } = app useEffect(() => { - updateNavigation( - ['typography'], - { - __title: 'Typography', - __linktitle: 'Typography', - __slug: 'typography', - __order: 'typography' - }) + updateNavigation(['typography'], { + __title: 'Typography', + __linktitle: 'Typography', + __slug: 'typography', + __order: 'typography', + }) }, [updateNavigation]) const p = (

- This paragraph is here to show the vertical spacing between headings and paragraphs. - In addition, let's make it a bit longer so we can see the line height as the text wraps. + This paragraph is here to show the vertical spacing between headings and paragraphs. In + addition, let's make it a bit longer so we can see the line height as the text wraps.

) return ( - +

This typography page shows an overview of different elements and how they are styled.

It's a good starting point for theme development.

Headings (this is h2)

{p} -

This is h3

{p} -

This is h4

{p} -
This is h5
{p} -
This is h6
{p} +

This is h3

+ {p} +

This is h4

+ {p} +
This is h5
+ {p} +
This is h6
+ {p}

Links and buttons

-

A regular link looks like this, whereas buttons look like this:

+

+ A regular link looks like this, whereas buttons look like this: +

Main button styles

@@ -77,7 +81,7 @@ const TypographyPage = (props) => {

Popouts

The Popout component is what powers various custom MDX components under the hood:

- {['note', 'tip', 'warning', 'fixme', 'link', 'related', 'none'].map(type => { + {['note', 'tip', 'warning', 'fixme', 'link', 'related', 'none'].map((type) => { const props = {} props[type] = true return ( @@ -96,4 +100,3 @@ const TypographyPage = (props) => { } export default TypographyPage -