diff --git a/bin/generateScreenshot.ts b/bin/generateScreenshot.ts index 0081d4a..6311ad9 100644 --- a/bin/generateScreenshot.ts +++ b/bin/generateScreenshot.ts @@ -13,20 +13,20 @@ const main = () => { } const pattern = args[2]; - + (async () => { - const browser = await puppeteer.launch(); - + const browser = await puppeteer.launch(); + const page = await browser.newPage(); await page.goto(`http://localhost:3000/${pattern}`); await page.waitForSelector('.demo__live'); const element = await page.$('.demo__live'); await element.screenshot({ - path: `public/assets/patterns/${pattern}.png` + path: `public/assets/patterns/${pattern}.png`, }); await page.close(); - + await browser.close(); })(); }; diff --git a/client/App.tsx b/client/App.tsx deleted file mode 100644 index 11765c4..0000000 --- a/client/App.tsx +++ /dev/null @@ -1,30 +0,0 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - -import * as React from 'react'; -import { BrowserRouter as Router, Route, Switch as RouteSwitch } from 'react-router-dom'; - -import './index.css'; - -import ExplorePage from './pages/ExplorePage'; -import HomePage from './pages/HomePage'; -import PatternPage from './pages/PatternPage'; - -const App = () => { - return ( - - - - - } // tslint:disable-line - /> - - - ); -}; - -export default App; diff --git a/client/components/Product.tsx b/client/components/Product.tsx deleted file mode 100644 index db153d1..0000000 --- a/client/components/Product.tsx +++ /dev/null @@ -1,28 +0,0 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - -import * as React from 'react'; - -import './product.css'; -import ProductModel from '../constants/ProductModel'; -import slug from '../../utils/slug'; - -interface ProductProps { - product: ProductModel; -} - -const Product: React.FC = ({ product }) => { - return ( -
- - {`${product.name} -

{product.name}

-
{product.description}
-
-
- ); -}; - -export default Product; diff --git a/client/components/SampleCode.tsx b/client/components/SampleCode.tsx deleted file mode 100644 index cafb366..0000000 --- a/client/components/SampleCode.tsx +++ /dev/null @@ -1,27 +0,0 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - -import * as React from 'react'; - -import highlight from '../helpers/highlight'; - -interface SampleCodeProps { - code: string; - fullHeight?: boolean; - lang: string; -} - -const SampleCode: React.FC = ({ code, fullHeight = false, lang }) => { - return code === '' - ? <> - : ( -
-            );
-};
-
-export default SampleCode;
diff --git a/client/components/ad.css b/client/components/ad.css
deleted file mode 100644
index 89b7ee0..0000000
--- a/client/components/ad.css
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * A collection of popular layouts and patterns made with CSS (https://csslayout.io)
- * (c) 2019 - 2021 Nguyen Huu Phuoc 
- */
-
-#carbonads {
-    border: 1px solid rgba(0, 0, 0, .3);
-    border-radius: 0.5rem;
-    padding: 0.5rem;
-}
-.carbon-img {
-    display: block;
-    margin-bottom: 0.5rem;
-    text-align: center;
-}
-.carbon-poweredby {
-    display: block;
-    font-size: 0.75rem;
-    text-align: right;
-}
-.carbon-text {
-    display: block;
-}
diff --git a/client/components/heading.css b/client/components/heading.css
deleted file mode 100644
index 11077a6..0000000
--- a/client/components/heading.css
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * A collection of popular layouts and patterns made with CSS (https://csslayout.io)
- * (c) 2019 - 2021 Nguyen Huu Phuoc 
- */
-
-.heading {
-    color: var(--color-gray-9);
-    display: grid;
-    font-size: 2rem;
-    grid-template-columns: 1fr auto 1fr;
-    grid-gap: 1rem;
-    text-align: center;
-}
-.heading::before,
-.heading::after {
-    align-self: center;
-    border-top: 0.25rem double var(--color-gray-9);
-    content: '';
-}
diff --git a/client/components/product.css b/client/components/product.css
deleted file mode 100644
index cfcbfde..0000000
--- a/client/components/product.css
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * A collection of popular layouts and patterns made with CSS (https://csslayout.io)
- * (c) 2019 - 2021 Nguyen Huu Phuoc 
- */
-
-.product {
-    border-radius: 0.5rem;
-    color: #FFF;
-    margin: 1rem 0;
-    overflow: hidden;
-    padding: 1rem;
-}
-.product a {
-    color: #FFF;
-    text-align: center;
-    text-decoration: none;
-}
-.product__logo {
-    display: flex;
-    height: auto;
-    margin: 0 auto;
-    width: 6rem;
-}
-.product__name {
-    font-size: 1.5rem;
-    margin: 1rem;
-}
-.product__desc {
-    text-align: center;
-}
\ No newline at end of file
diff --git a/client/helpers/chunk.ts b/client/helpers/chunk.ts
deleted file mode 100644
index e90cfd5..0000000
--- a/client/helpers/chunk.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-/**
- * A collection of popular layouts and patterns made with CSS (https://csslayout.io)
- * (c) 2019 - 2021 Nguyen Huu Phuoc 
- */
-
-function chunk(arr: T[], size: number): T[][] {
-    return arr.reduce((acc, e, i) => (i % size ? acc[acc.length - 1].push(e) : acc.push([e]), acc), []);
-};
-
-export default chunk;
diff --git a/client/helpers/highlight.ts b/client/helpers/highlight.ts
deleted file mode 100755
index abd0271..0000000
--- a/client/helpers/highlight.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * A collection of popular layouts and patterns made with CSS (https://csslayout.io)
- * (c) 2019 - 2021 Nguyen Huu Phuoc 
- */
-
-import Prism from 'prismjs';
-
-const highlight = (input: string, language: string) => {
-    const lang = language || 'html';
-    const value = Prism.highlight(input, Prism.languages[language], language);
-    const highlighted = value.replace('&', '&').trim();
-
-    return `${highlighted}`;
-};
-
-export default highlight;
\ No newline at end of file
diff --git a/client/helpers/shuffe.ts b/client/helpers/shuffe.ts
deleted file mode 100644
index eb53299..0000000
--- a/client/helpers/shuffe.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-/**
- * A collection of popular layouts and patterns made with CSS (https://csslayout.io)
- * (c) 2019 - 2021 Nguyen Huu Phuoc 
- */
-
-const shuffe = (array: number[]) => {
-    array.sort(() => Math.random() - 0.5);
-    return array;
-};
-
-export default shuffe;
diff --git a/client/hooks/useInterval.ts b/client/hooks/useInterval.ts
deleted file mode 100644
index 7848f28..0000000
--- a/client/hooks/useInterval.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * A collection of popular layouts and patterns made with CSS (https://csslayout.io)
- * (c) 2019 - 2021 Nguyen Huu Phuoc 
- */
-
-import { useEffect } from 'react';
-
-const useInterval = (callback: () => void, delay?: number) => {
-    useEffect(
-        () => {
-            const handler = () => callback();
-            if (delay !== null) {
-                const id = setInterval(handler, delay);
-                return () => clearInterval(id);
-            }
-        },
-        [delay],
-    );
-};
-
-export default useInterval;
diff --git a/client/index.css b/client/index.css
deleted file mode 100644
index 942a095..0000000
--- a/client/index.css
+++ /dev/null
@@ -1,179 +0,0 @@
-/**
- * A collection of popular layouts and patterns made with CSS (https://csslayout.io)
- * (c) 2019 - 2021 Nguyen Huu Phuoc 
- */
-
-:root {
-    --background-color: #e7d900;
-    --color-blue-6: #2563EB;
-    --color-gray-2: #E5E7EB;
-    --color-gray-5: #6B7280;
-    --color-gray-8: #27272A;
-    --color-gray-9: #111827;
-} 
-body {
-    font-family: Lato, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
-    margin: 0;
-}
-* {
-    box-sizing: border-box;
-}
-a {
-    text-decoration: none;
-}
-
-::-webkit-scrollbar {
-    height: 0.5rem;
-    width: 0.5rem;
-}
-::-webkit-scrollbar-thumb {
-    background-color: var(--color-gray-5);
-    border-radius: 0.5rem;
-}
-::-webkit-scrollbar-track {
-    background-color: transparent;
-    border-radius: 0.5rem;
-}
-
-/* Layout */
-.container {
-    margin: 0 auto;
-    max-width: 80rem;
-    padding: 0 1rem;
-}
-.main {
-    flex: 1;
-    overflow: hidden;
-    padding: 4rem 0;
-}
-.sidebar {
-    display: none;
-    padding: 4rem 0;
-}
-
-/* Sidebar */
-.sidebar__inner {    
-    position: sticky;
-    top: 1rem;
-}
-
-/* Hero */
-.hero {
-    --current-background-color: var(--background-color);
-    background: var(--background-color);
-    display: flex;
-    justify-content: center;
-    padding-bottom: 1rem;
-}
-.hero__logo {
-    display: flex;
-    justify-content: center;
-}
-.hero__logo img {
-    object-fit: cover;
-    width: 16rem;
-}
-.hero__heading {
-    color: var(--color-gray-9);
-    font-size: 2rem;
-    line-height: 1.5;
-    text-align: center;
-    text-transform: uppercase;
-}
-.hero__subheading {
-    color: var(--color-gray-9);
-    font-size: 1.5rem;
-    line-height: 1.5;
-    text-align: center;
-}
-
-/*
-Prism theme
-Credit to https://github.com/tailwindlabs/tailwindcss.com/blob/master/src/css/prism.css
-*/
-pre {
-    background: var(--color-gray-8);
-    border: none;
-    border-radius: 0px;
-    box-shadow: none;
-    color: #FFF;
-    font-family: "Source Code Pro", monospace;
-    font-size: 1rem;
-    line-height: 1.5;
-    margin: 0px;
-    overflow-x: auto;
-    padding: 1rem;
-    white-space: pre;
-}
-
-.token.tag,
-.token.class-name,
-.token.selector,
-.token.selector .class,
-.token.function {
-    color: #E879F9;
-}
-
-.token.attr-name,
-.token.keyword,
-.token.rule,
-.token.operator,
-.token.pseudo-class,
-.token.important {
-    color: #22D3EE;
-}
-
-.token.attr-value,
-.token.class,
-.token.string,
-.token.number,
-.token.unit,
-.token.color {
-    color: #BEF264;
-}
-
-.token.punctuation,
-.token.module,
-.token.property {
-    color: #BAE6FD;
-}
-
-.token.atapply .token:not(.rule):not(.important) {
-    color: inherit;
-}
-
-.language-shell .token:not(.comment) {
-    color: inherit;
-}
-
-.language-css .token.function {
-    color: inherit;
-}
-
-.token.comment {
-    color: #A1A1AA;
-}
-
-/* Responsive */
-@media (min-width: 640px) {
-    .content {
-        display: flex;
-    }
-    .sidebar {
-        display: block;
-        flex: 0 0 8rem;
-        margin-left: 0.5rem;
-    }
-}
-@media (min-width: 768px) {
-    .sidebar {
-        flex-basis: 12rem;
-        margin-left: 1rem;
-    }
-}
-@media (min-width: 1024px) {
-    .sidebar {
-        flex-basis: 16rem;
-        margin-left: 2rem;
-    }
-}
\ No newline at end of file
diff --git a/client/index.html b/client/index.html
deleted file mode 100644
index 40fad5e..0000000
--- a/client/index.html
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-
-
-    
- - - - \ No newline at end of file diff --git a/client/index.tsx b/client/index.tsx deleted file mode 100644 index 003af80..0000000 --- a/client/index.tsx +++ /dev/null @@ -1,14 +0,0 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - -import * as React from 'react'; -import { hydrate, render } from 'react-dom'; - -import App from './App'; - -const rootElement = document.getElementById('root'); -rootElement.hasChildNodes() - ? hydrate(, rootElement) - : render(, rootElement); diff --git a/client/types/hightlight.d.ts b/client/types/hightlight.d.ts deleted file mode 100644 index 7b8cf2a..0000000 --- a/client/types/hightlight.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - -declare module 'highlight.js/lib/highlight' { - interface HighlightResult { - value: string; - } - - function highlight(lang: string, code: string): HighlightResult; - function registerLanguage(name: string, language: any): void; -} - -declare module 'highlight.js/lib/languages/javascript' {} -declare module 'highlight.js/lib/languages/xml' {} diff --git a/client/components/Ad.tsx b/components/Ad.tsx similarity index 58% rename from client/components/Ad.tsx rename to components/Ad.tsx index 0ba2a5b..aa89a13 100644 --- a/client/components/Ad.tsx +++ b/components/Ad.tsx @@ -1,21 +1,10 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; -import './ad.css'; - -const Ad: React.FC<{}> = () => { +export const Ad: React.FC<{}> = () => { const containerRef = React.useRef(null); const source = 'https://cdn.carbonads.com/carbon.js?serve=CE7I6KQL&placement=csslayoutio'; React.useEffect(() => { - // Ignore if the code is reached in snapping mode - if (navigator.userAgent === 'ReactSnap') { - return; - } const container = containerRef.current; if (!container) { return; @@ -32,9 +21,5 @@ const Ad: React.FC<{}> = () => { }; }, []); - return ( -
- ); + return
; }; - -export default Ad; diff --git a/components/CoverCard.tsx b/components/CoverCard.tsx index 8769ef5..3b90aa3 100644 --- a/components/CoverCard.tsx +++ b/components/CoverCard.tsx @@ -142,9 +142,7 @@ export const CoverCard: React.FC = ({ pattern }) => { -

- {pattern} -

+

{pattern}

); diff --git a/components/RelatedPatterns.tsx b/components/RelatedPatterns.tsx index fd71706..357c7d8 100644 --- a/components/RelatedPatterns.tsx +++ b/components/RelatedPatterns.tsx @@ -1,22 +1,20 @@ import * as React from 'react'; -import { Heading, Spacer } from '@1milligram/design'; +import { Heading } from '@1milligram/design'; import { Pattern } from '../constants/Pattern'; import { CoverCard } from './CoverCard'; -interface RelatedPatternsProps { +export const RelatedPatterns: React.FC<{ patterns: Pattern[]; -} - -export const RelatedPatterns: React.FC = ({ patterns }) => { +}> = ({ patterns }) => { return (
See also
- { - patterns.map((pattern) => ) - } + {patterns.map((pattern) => ( + + ))}
); diff --git a/constants/Pattern.ts b/constants/Pattern.ts index 72d8c5d..6242507 100644 --- a/constants/Pattern.ts +++ b/constants/Pattern.ts @@ -101,4 +101,4 @@ export enum Pattern { Watermark = 'Watermark', Wizard = 'Wizard', ZigzagTimeline = 'Zigzag timeline', -}; +} diff --git a/hooks/useInterval.ts b/hooks/useInterval.ts new file mode 100644 index 0000000..e7db0ec --- /dev/null +++ b/hooks/useInterval.ts @@ -0,0 +1,13 @@ +import { useEffect } from 'react'; + +const useInterval = (callback: () => void, delay?: number) => { + useEffect(() => { + const handler = () => callback(); + if (delay !== null) { + const id = setInterval(handler, delay); + return () => clearInterval(id); + } + }, [delay]); +}; + +export default useInterval; diff --git a/layouts/DetailsLayout.tsx b/layouts/PatternLayout.tsx similarity index 79% rename from layouts/DetailsLayout.tsx rename to layouts/PatternLayout.tsx index 9a72861..f485c23 100644 --- a/layouts/DetailsLayout.tsx +++ b/layouts/PatternLayout.tsx @@ -2,21 +2,20 @@ import * as React from 'react'; import Head from 'next/head'; import { Heading, Spacer } from '@1milligram/design'; +import { Ad } from '../components/Ad'; import { Pattern } from '../constants/Pattern'; import { slug } from '../utils/slug'; import { Layout } from './Layout'; -interface DetailsLayoutProps { +export const PatternLayout: React.FC<{ pattern: Pattern; -} - -export const DetailsLayout: React.FC = ({ pattern, children }) => { +}> = ({ pattern, children }) => { const patternSlug = slug(pattern); return ( - CSS Layout ∙ {pattern} + {pattern} - CSS Layout @@ -33,9 +32,13 @@ export const DetailsLayout: React.FC = ({ pattern, children {pattern} +
+ +
+
- {children} +
); diff --git a/package.json b/package.json index a882596..dc8d833 100644 --- a/package.json +++ b/package.json @@ -32,9 +32,7 @@ "screenshot": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' ts-node bin/generateScreenshot.ts" }, "dependencies": { - "@loadable/component": "^5.14.1", "@1milligram/design": "^0.4.0", - "@1milligram/frame": "^1.0.0", "@mdx-js/loader": "^1.6.22", "@mdx-js/react": "^1.6.22", "@next/mdx": "^11.1.2", @@ -44,8 +42,6 @@ "react-dom": "^17.0.2" }, "devDependencies": { - "@types/linkifyjs": "^2.1.4", - "@types/loadable__component": "^5.13.3", "@types/react": "^17.0.20", "@types/react-dom": "^17.0.9", "puppeteer": "^10.4.0", diff --git a/pages/_document.tsx b/pages/_document.tsx index d0bfb8d..6343080 100644 --- a/pages/_document.tsx +++ b/pages/_document.tsx @@ -9,16 +9,25 @@ class MyDocument extends Document { - + - + - + diff --git a/pages/accordion/index.tsx b/pages/accordion/index.tsx index 7fbf2d8..7cce5b9 100644 --- a/pages/accordion/index.tsx +++ b/pages/accordion/index.tsx @@ -1,14 +1,10 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; @@ -23,7 +19,7 @@ const Details: React.FC<{}> = () => { const [activeItem, setActiveItem] = React.useState(1); const Item: React.FC = ({ index, title, children }) => { - const isOpened = (index === activeItem); + const isOpened = index === activeItem; const click = () => setActiveItem(isOpened ? -1 : index); return ( <> @@ -57,16 +53,15 @@ const Details: React.FC<{}> = () => { }; return ( - + -
-
@@ -92,93 +87,112 @@ html={` ...
`} -css={` -.accordion { - /* Border */ - border: 1px solid rgba(0, 0, 0, 0.3); - border-bottom-color: transparent; - border-radius: 4px; -} + css={` + .accordion { + /* Border */ + border: 1px solid rgba(0, 0, 0, 0.3); + border-bottom-color: transparent; + border-radius: 4px; + } -.accordion__item { - border-bottom: 1px solid rgba(0, 0, 0, 0.3); -} + .accordion__item { + border-bottom: 1px solid rgba(0, 0, 0, 0.3); + } -.accordion__header { - /* Center the content horizontally */ - align-items: center; - display: flex; + .accordion__header { + /* Center the content horizontally */ + align-items: center; + display: flex; - cursor: pointer; - padding: 16px; -} + cursor: pointer; + padding: 16px; + } -.accordion__toggle { - margin-right: 12px; -} + .accordion__toggle { + margin-right: 12px; + } -.accordion__title { - /* Take remaining width */ - flex: 1; -} + .accordion__title { + /* Take remaining width */ + flex: 1; + } -.accordion__content { - /* For not selected item */ - display: none; + .accordion__content { + /* For not selected item */ + display: none; - border-top: 1px solid rgba(0, 0, 0, 0.3); - padding: 16px; -} + border-top: 1px solid rgba(0, 0, 0, 0.3); + padding: 16px; + } -.accordion__content--selected { - /* For selected item */ - display: block; -} -`} + .accordion__content--selected { + /* For selected item */ + display: block; + } + `} + > +
-
+ +
+ } > -
} - > -
- -
} - > -
- -
} - > -
- - +
+ +
+ + + + + } + > +
+ +
+
+ + + + } + > +
+ +
+
- - + + + + -
+ ); }; diff --git a/pages/arrow-buttons/index.tsx b/pages/arrow-buttons/index.tsx index 1b4ad1e..6117f8e 100644 --- a/pages/arrow-buttons/index.tsx +++ b/pages/arrow-buttons/index.tsx @@ -1,28 +1,23 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { return ( - + -
- `} -css={` -.button { - /* Center the content */ - align-items: center; - display: flex; - justify-content: center; + css={` + .button { + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; - /* Spacing */ - padding: 8px; -} + /* Spacing */ + padding: 8px; + } -.button__arrow { - /* Transparent background */ - background-color: transparent; + .button__arrow { + /* Transparent background */ + background-color: transparent; - /* Size */ - height: 12px; - width: 12px; -} + /* Size */ + height: 12px; + width: 12px; + } -.button__arrow--up { - /* Edges */ - border-left: 1px solid rgba(0, 0, 0, 0.3); - border-top: 1px solid rgba(0, 0, 0, 0.3); - transform: translateY(25%) rotate(45deg); -} + .button__arrow--up { + /* Edges */ + border-left: 1px solid rgba(0, 0, 0, 0.3); + border-top: 1px solid rgba(0, 0, 0, 0.3); + transform: translateY(25%) rotate(45deg); + } -.button__arrow--right { - /* Edges */ - border-right: 1px solid rgba(0, 0, 0, 0.3); - border-top: 1px solid rgba(0, 0, 0, 0.3); - transform: translateX(-25%) rotate(45deg); -} + .button__arrow--right { + /* Edges */ + border-right: 1px solid rgba(0, 0, 0, 0.3); + border-top: 1px solid rgba(0, 0, 0, 0.3); + transform: translateX(-25%) rotate(45deg); + } -.button__arrow--down { - /* Edges */ - border-bottom: 1px solid rgba(0, 0, 0, 0.3); - border-right: 1px solid rgba(0, 0, 0, 0.3); - transform: translateY(-25%) rotate(45deg); -} + .button__arrow--down { + /* Edges */ + border-bottom: 1px solid rgba(0, 0, 0, 0.3); + border-right: 1px solid rgba(0, 0, 0, 0.3); + transform: translateY(-25%) rotate(45deg); + } -.button__arrow--left { - /* Edges */ - border-bottom: 1px solid rgba(0, 0, 0, 0.3); - border-left: 1px solid rgba(0, 0, 0, 0.3); - transform: translateX(25%) rotate(45deg); -} -`} + .button__arrow--left { + /* Edges */ + border-bottom: 1px solid rgba(0, 0, 0, 0.3); + border-left: 1px solid rgba(0, 0, 0, 0.3); + transform: translateX(25%) rotate(45deg); + } + `} + > +
-
- -
-
+
Up
+ +
+
+
+
-
Right
-
- -
-
+ +
+
+ -
-
+
Down
+ +
+
+ -
+ /> +
Left
+
- -
+
+
+ - + ); }; diff --git a/pages/avatar-list/index.tsx b/pages/avatar-list/index.tsx index ad9e787..52719a0 100644 --- a/pages/avatar-list/index.tsx +++ b/pages/avatar-list/index.tsx @@ -1,14 +1,10 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Avatar: React.FC<{}> = ({ children }) => { @@ -33,16 +29,15 @@ const Avatar: React.FC<{}> = ({ children }) => { const Details: React.FC<{}> = () => { return ( - + -
-
@@ -56,52 +51,63 @@ html={` ...
`} -css={` -.avatars { - display: flex; -} + css={` + .avatars { + display: flex; + } -.avatars__item { - /* Nagative margin make avatar overlap to previous one */ - margin-left: -4px; -} + .avatars__item { + /* Nagative margin make avatar overlap to previous one */ + margin-left: -4px; + } -.avatars__image { - /* Add a white curve between avatars */ - box-shadow: 0 0 0 4px #FFF; + .avatars__image { + /* Add a white curve between avatars */ + box-shadow: 0 0 0 4px #fff; - /* Center the content */ - align-items: center; - display: flex; - justify-content: center; + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; - /* Rounded border */ - border-radius: 9999px; -} -`} + /* Rounded border */ + border-radius: 9999px; + } + `} + > +
-
-
-
-
-
-
+5
+
+
- -
+
+ +
+
+ +
+
+ +
+
+ +5 +
+
+
+ + - + ); }; diff --git a/pages/avatar/index.tsx b/pages/avatar/index.tsx index 82691b0..510a2a0 100644 --- a/pages/avatar/index.tsx +++ b/pages/avatar/index.tsx @@ -1,19 +1,15 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { return ( - + @@ -21,29 +17,29 @@ const Details: React.FC<{}> = () => {
`} -css={` -.avatar { - /* Rounded border */ - border-radius: 50%; - height: 64px; - width: 64px; -} + css={` + .avatar { + /* Rounded border */ + border-radius: 50%; + height: 64px; + width: 64px; + } -.avatar__image { - /* Rounded border */ - border-radius: 50%; + .avatar__image { + /* Rounded border */ + border-radius: 50%; - /* Take full size */ - height: 100%; - width: 100%; -} -`} + /* Take full size */ + height: 100%; + width: 100%; + } + `} >
- + -
+ ); }; diff --git a/pages/badge/index.tsx b/pages/badge/index.tsx index 8c7db88..09553e3 100644 --- a/pages/badge/index.tsx +++ b/pages/badge/index.tsx @@ -1,82 +1,77 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { return ( - + -
- ...
`} -css={` -.badge { - /* Center the content */ - align-items: center; - display: flex; - justify-content: center; + css={` + .badge { + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; - /* Colors */ - background-color: rgba(0, 0, 0, .3); - color: #FFF; + /* Colors */ + background-color: rgba(0, 0, 0, 0.3); + color: #fff; - /* Rounded border */ - border-radius: 9999px; - height: 32px; - width: 32px; -} -`} + /* Rounded border */ + border-radius: 9999px; + height: 32px; + width: 32px; + } + `} + > +
-
- 1 -
+ 1
- -
+
+ + -
+ ); }; diff --git a/pages/breadcrumb/index.tsx b/pages/breadcrumb/index.tsx index e9be28b..3a775db 100644 --- a/pages/breadcrumb/index.tsx +++ b/pages/breadcrumb/index.tsx @@ -1,28 +1,22 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + -
- ... @@ -34,41 +28,48 @@ html={` ...
`} -css={` -.breadcrumb { - /* Content is centered vertically */ - align-items: center; - display: flex; -} + css={` + .breadcrumb { + /* Content is centered vertically */ + align-items: center; + display: flex; + } -.breadcrumb__separator { - margin: 0 8px; -} -`} + .breadcrumb__separator { + margin: 0 8px; + } + `} + > +
-
-
-
-
/
-
-
/
-
-
/
-
+
+
+ +
+
/
+
+ +
+
/
+
+ +
+
/
+
+
- -
- +
+ + ); }; diff --git a/pages/button-with-icon/index.tsx b/pages/button-with-icon/index.tsx index 3489995..d1fa12c 100644 --- a/pages/button-with-icon/index.tsx +++ b/pages/button-with-icon/index.tsx @@ -1,29 +1,23 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Circle from '../../placeholders/Circle'; import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + -
- ... @@ -32,46 +26,47 @@ html={` ...
`} -css={` -.button { - /* Center the content */ - align-items: center; - display: flex; - flex-direction: row; - justify-content: center; -} -`} + css={` + .button { + /* Center the content */ + align-items: center; + display: flex; + flex-direction: row; + justify-content: center; + } + `} + > +
-
-
- -
+
+
- -
- +
+ +
); }; diff --git a/pages/card-layout/index.tsx b/pages/card-layout/index.tsx index 05c0ff5..bae1ae7 100644 --- a/pages/card-layout/index.tsx +++ b/pages/card-layout/index.tsx @@ -1,20 +1,16 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + @@ -22,7 +18,7 @@ const Details: React.FC<{}> = () => {
@@ -33,25 +29,25 @@ html={` ...
`} -css={` -.cards { - display: flex; + css={` + .cards { + display: flex; - /* Put a card in the next row when previous cards take all width */ - flex-wrap: wrap; + /* Put a card in the next row when previous cards take all width */ + flex-wrap: wrap; - margin-left: -8px; - margin-right: -8px; -} + margin-left: -8px; + margin-right: -8px; + } -.cards__item { - /* There will be 4 cards per row */ - flex-basis: 25%; + .cards__item { + /* There will be 4 cards per row */ + flex-basis: 25%; - padding-left: 8px; - padding-right: 8px; -} -`} + padding-left: 8px; + padding-right: 8px; + } + `} >
- { - Array(10).fill(0).map((_, index) => { + {Array(10) + .fill(0) + .map((_, index) => { return ( -
+
); - }) - } + })}
+ -
+ ); }; diff --git a/pages/card/index.tsx b/pages/card/index.tsx index d60abfe..b1b6f68 100644 --- a/pages/card/index.tsx +++ b/pages/card/index.tsx @@ -1,21 +1,17 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + @@ -23,7 +19,7 @@ const Details: React.FC<{}> = () => {
@@ -37,22 +33,22 @@ html={` ...
`} -css={` -.card { - display: flex; - flex-direction: column; -} + css={` + .card { + display: flex; + flex-direction: column; + } -.card__cover { - height: 150px; - width: 100%; -} + .card__cover { + height: 150px; + width: 100%; + } -.card__content { - /* Take available height */ - flex: 1; -} -`} + .card__content { + /* Take available height */ + flex: 1; + } + `} >
-
+
+ +
@@ -84,8 +82,11 @@ css={`
- - + + + ); }; diff --git a/pages/centering/index.tsx b/pages/centering/index.tsx index 727fe3d..9f98624 100644 --- a/pages/centering/index.tsx +++ b/pages/centering/index.tsx @@ -1,59 +1,58 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Circle from '../../placeholders/Circle'; import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + -
- ...
`} -css={` -.container { - align-items: center; - display: flex; - justify-content: center; -} -`} + css={` + .container { + align-items: center; + display: flex; + justify-content: center; + } + `} + > +
-
- -
-
-
+ +
+
- -
- +
+ +
+
+ +
+
+ +
); }; diff --git a/pages/chip/InputChip.tsx b/pages/chip/InputChip.tsx deleted file mode 100644 index ea8748d..0000000 --- a/pages/chip/InputChip.tsx +++ /dev/null @@ -1,60 +0,0 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - -import * as React from 'react'; - -const InputChip: React.FC<{}> = ({ children }) => { - return ( -
-
- {children} -
- -
- ); -}; - -export default InputChip; diff --git a/pages/chip/index.tsx b/pages/chip/index.tsx index 71340b4..e264bab 100644 --- a/pages/chip/index.tsx +++ b/pages/chip/index.tsx @@ -1,33 +1,81 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Link } from 'react-router-dom'; +import Link from 'next/link'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; -import InputChip from './InputChip'; + +const InputChip: React.FC<{}> = ({ children }) => { + return ( +
+
{children}
+ +
+ ); +}; const Details: React.FC<{}> = () => { return ( - + -
-
- You can use a close button to remove a chip. -
- + You can use a{' '} + + close button + {' '} + to remove a chip. +
+
@@ -39,44 +87,44 @@ html={` ...
`} -css={` -.chip { - /* Center the content */ - align-items: center; - display: inline-flex; - justify-content: center; + css={` + .chip { + /* Center the content */ + align-items: center; + display: inline-flex; + justify-content: center; - /* Background color */ - background-color: rgba(0, 0, 0, .1); + /* Background color */ + background-color: rgba(0, 0, 0, 0.1); - /* Rounded border */ - border-radius: 9999px; + /* Rounded border */ + border-radius: 9999px; - /* Spacing */ - padding: 4px 8px; -} + /* Spacing */ + padding: 4px 8px; + } -.chip__content { - margin-right: 4px; -} -`} + .chip__content { + margin-right: 4px; + } + `} + > +
-
- CSS -
- -
+ CSS +
+
+ -
+ ); }; diff --git a/pages/circular-navigation/index.tsx b/pages/circular-navigation/index.tsx index 4899062..0703484 100644 --- a/pages/circular-navigation/index.tsx +++ b/pages/circular-navigation/index.tsx @@ -1,13 +1,8 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Square from '../../placeholders/Square'; @@ -49,16 +44,15 @@ const Details: React.FC<{}> = () => { const numItems = 6; return ( - + -
- ... @@ -75,75 +69,76 @@ html={` ...
`} -css={` -.navigation { - position: relative; -} + css={` + .navigation { + position: relative; + } -.navigation__circle { - /* Position */ - position: absolute; - top: 0; - - /* + .navigation__circle { + /* Position */ + position: absolute; + top: 0; + + /* 80px is the distance from the item to the trigger element. Replace 0deg with 60deg, 180deg, 240deg, 300deg for another item in case you want to have a total of 6 menu items. The formulation is 360 / numberOfItems * indexOfItem */ - transform: rotate(0deg) translateX(-80px); + transform: rotate(0deg) translateX(-80px); - /* Must have the same size as the trigger element */ - height: 32px; - width: 32px; -} + /* Must have the same size as the trigger element */ + height: 32px; + width: 32px; + } -.navigation__content { - /* + .navigation__content { + /* Rotate it to make it displayed vertically Replace -0deg with -60deg, -180deg, -240deg, -300deg for another item in case you want to have a total of 6 menu items. The formulation is -(360 / numberOfItems * indexOfItem) */ - transform: rotate(-0deg); + transform: rotate(-0deg); - /* Center the content */ - align-items: center; - display: flex; - justify-content: center; + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; - /* Take full size */ - height: 100%; - width: 100%; -} -`} + /* Take full size */ + height: 100%; + width: 100%; + } + `} + > +
-
-
-
- -
- { - Array(numItems).fill(0).map((_, i) => { - return ( - {i + 1} - ); - }) - } +
+
+
+ {Array(numItems) + .fill(0) + .map((_, i) => { + return ( + + {i + 1} + + ); + })}
- -
- +
+ + ); }; diff --git a/pages/close-button/index.tsx b/pages/close-button/index.tsx index 87a6600..2a2224f 100644 --- a/pages/close-button/index.tsx +++ b/pages/close-button/index.tsx @@ -1,135 +1,130 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { return ( - + -
-
`} -css={` -.button { - /* Reset */ - background-color: transparent; - border-color: transparent; + css={` + .button { + /* Reset */ + background-color: transparent; + border-color: transparent; - /* Cursor */ - cursor: pointer; + /* Cursor */ + cursor: pointer; - /* Size */ - height: 32px; - width: 32px; + /* Size */ + height: 32px; + width: 32px; - /* Used to position the inner */ - position: relative; -} + /* Used to position the inner */ + position: relative; + } -.button__line { - /* Background color */ - background-color: rgba(0, 0, 0, 0.3); + .button__line { + /* Background color */ + background-color: rgba(0, 0, 0, 0.3); - /* Position */ - position: absolute; + /* Position */ + position: absolute; - /* Size */ - height: 1px; - width: 100%; -} + /* Size */ + height: 1px; + width: 100%; + } -.button__line--first { - /* Position */ - left: 0px; - top: 50%; - transform: translate(0%, -50%) rotate(45deg); + .button__line--first { + /* Position */ + left: 0px; + top: 50%; + transform: translate(0%, -50%) rotate(45deg); - /* Size */ - height: 1px; - width: 100%; -} + /* Size */ + height: 1px; + width: 100%; + } -.button__line--second { - /* Position */ - left: 50%; - top: 0px; - transform: translate(-50%, 0%) rotate(45deg); + .button__line--second { + /* Position */ + left: 50%; + top: 0px; + transform: translate(-50%, 0%) rotate(45deg); - /* Size */ - height: 100%; - width: 1px; -} -`} + /* Size */ + height: 100%; + width: 1px; + } + `} + > +
-
- -
- -
+ /> +
+ +
+
+ - + ); }; diff --git a/pages/color-swatch/index.tsx b/pages/color-swatch/index.tsx index 41b15a6..e3df502 100644 --- a/pages/color-swatch/index.tsx +++ b/pages/color-swatch/index.tsx @@ -1,18 +1,13 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { return ( - + @@ -20,7 +15,7 @@ const Details: React.FC<{}> = () => {
@@ -28,22 +23,22 @@ html={` ...
`} -css={` -.swatch { - /* Wrap the items */ - display: flex; - flex-wrap: wrap; -} -.swatch__item { - /* Rounded border */ - border-radius: 9999px; - height: 1.5rem; - width: 1.5rem; + css={` + .swatch { + /* Wrap the items */ + display: flex; + flex-wrap: wrap; + } + .swatch__item { + /* Rounded border */ + border-radius: 9999px; + height: 1.5rem; + width: 1.5rem; - /* Space between items */ - margin: 0.5rem; -} -`} + /* Space between items */ + margin: 0.5rem; + } + `} >
- { - Array(9).fill(0).map((_, index) => ( -
- )) - } + {Array(9) + .fill(0) + .map((_, index) => ( +
+ ))}
- + ); }; diff --git a/pages/concave-corners/index.tsx b/pages/concave-corners/index.tsx index cab7c7e..dcf9565 100644 --- a/pages/concave-corners/index.tsx +++ b/pages/concave-corners/index.tsx @@ -1,19 +1,15 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { return ( - + @@ -21,7 +17,7 @@ const Details: React.FC<{}> = () => {
@@ -39,69 +35,69 @@ html={` ...
`} -css={` -:root { - --concave-corners-background: rgba(0, 0, 0, .3); - --concave-corners-size: 1rem; -} + css={` + :root { + --concave-corners-background: rgba(0, 0, 0, 0.3); + --concave-corners-size: 1rem; + } -.concave-corners { - background-color: var(--concave-corners-background); - - /* Used to position the corners */ - position: relative; + .concave-corners { + background-color: var(--concave-corners-background); - /* Misc */ - height: 100%; -} + /* Used to position the corners */ + position: relative; -.concave-corners__corner { - /* Absolute position */ - position: absolute; + /* Misc */ + height: 100%; + } - /* Size */ - height: var(--concave-corners-size); - width: var(--concave-corners-size); + .concave-corners__corner { + /* Absolute position */ + position: absolute; - background: #FFF; -} + /* Size */ + height: var(--concave-corners-size); + width: var(--concave-corners-size); -.concave-corners__corner--tl { - /* Position */ - left: 0; - top: 0; + background: #fff; + } - /* Border radius */ - border-radius: 0 0 var(--concave-corners-size) 0; -} + .concave-corners__corner--tl { + /* Position */ + left: 0; + top: 0; -.concave-corners__corner--tr { - /* Position */ - right: 0; - top: 0; + /* Border radius */ + border-radius: 0 0 var(--concave-corners-size) 0; + } - /* Border radius */ - border-radius: 0 0 0 var(--concave-corners-size); -} + .concave-corners__corner--tr { + /* Position */ + right: 0; + top: 0; -.concave-corners__corner--bl { - /* Position */ - bottom: 0; - left: 0; + /* Border radius */ + border-radius: 0 0 0 var(--concave-corners-size); + } - /* Border radius */ - border-radius: 0 var(--concave-corners-size) 0 0; -} + .concave-corners__corner--bl { + /* Position */ + bottom: 0; + left: 0; -.concave-corners__corner--br { - /* Position */ - bottom: 0; - right: 0; + /* Border radius */ + border-radius: 0 var(--concave-corners-size) 0 0; + } - /* Border radius */ - border-radius: var(--concave-corners-size) 0 0 0; -} -`} + .concave-corners__corner--br { + /* Position */ + bottom: 0; + right: 0; + + /* Border radius */ + border-radius: var(--concave-corners-size) 0 0 0; + } + `} >
-
-
-
-
-
+
+
+
+
+
+ - + ); }; diff --git a/pages/cookie-banner/index.tsx b/pages/cookie-banner/index.tsx index cea829b..f49a4da 100644 --- a/pages/cookie-banner/index.tsx +++ b/pages/cookie-banner/index.tsx @@ -1,30 +1,25 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + -
- + + - + ); }; diff --git a/pages/corner-ribbon/index.tsx b/pages/corner-ribbon/index.tsx index b1ddbc9..702b040 100644 --- a/pages/corner-ribbon/index.tsx +++ b/pages/corner-ribbon/index.tsx @@ -1,30 +1,24 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Link } from 'react-router-dom'; +import Link from 'next/link'; +import { Heading, Spacer } from '@1milligram/design'; -import Heading from '../../components/Heading'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { return ( - + -
-
@@ -35,98 +29,102 @@ html={`
`} -css={` -.container { - position: relative; -} + css={` + .container { + position: relative; + } -.container__wrapper { - /* Displayed at the top left corner */ - left: 0px; - position: absolute; - top: 0px; + .container__wrapper { + /* Displayed at the top left corner */ + left: 0px; + position: absolute; + top: 0px; - /* Size */ - height: 100px; - width: 100px; + /* Size */ + height: 100px; + width: 100px; - /* Hide the part of its children which is displayed outside */ - overflow: hidden; -} + /* Hide the part of its children which is displayed outside */ + overflow: hidden; + } -.container__ribbon { - /* Position */ - left: -64px; - position: absolute; - top: 32px; + .container__ribbon { + /* Position */ + left: -64px; + position: absolute; + top: 32px; - /* Size */ - height: 24px; - width: 206px; + /* Size */ + height: 24px; + width: 206px; - /* Displayed diagonally */ - transform: rotate(-45deg); + /* Displayed diagonally */ + transform: rotate(-45deg); - /* Background color */ - background-color: rgba(0, 0, 0, 0.3); + /* Background color */ + background-color: rgba(0, 0, 0, 0.3); - /* Centerize the text content */ - text-align: center; -} -`} + /* Centerize the text content */ + text-align: center; + } + `} + > +
-
-
+ />
- -
+
+ + +
- + Use cases -
+
- You can add a ribbon to a pricing table to - indicate the most popular option. + You can add a ribbon to a{' '} + + pricing table + {' '} + to indicate the most popular option.
+ -
+ ); }; diff --git a/pages/curved-background/index.tsx b/pages/curved-background/index.tsx index c5782e5..c44b463 100644 --- a/pages/curved-background/index.tsx +++ b/pages/curved-background/index.tsx @@ -1,67 +1,62 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { return ( - + -
- ...
`} -css={` -.container { - /* Background color */ - background-color: rgba(0, 0, 0, 0.3); + css={` + .container { + /* Background color */ + background-color: rgba(0, 0, 0, 0.3); - /* You can use gradient background color such as + /* You can use gradient background color such as background: linear-gradient(rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.1) 100%); */ - /* Curved corners */ - border-bottom-left-radius: 50% 40%; - border-bottom-right-radius: 50% 40%; -} -`} + /* Curved corners */ + border-bottom-left-radius: 50% 40%; + border-bottom-right-radius: 50% 40%; + } + `} + > +
-
-
- -
+ /> +
+ + -
+ ); }; diff --git a/pages/custom-checkbox-button/index.tsx b/pages/custom-checkbox-button/index.tsx index 0fce33c..1f5fb96 100644 --- a/pages/custom-checkbox-button/index.tsx +++ b/pages/custom-checkbox-button/index.tsx @@ -1,14 +1,10 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; @@ -63,16 +59,15 @@ const Details: React.FC<{}> = () => { }; return ( - + -
- @@ -87,91 +82,97 @@ html={` ...
`} -css={` -.label { - /* Center the content horizontally */ - align-items: center; - display: inline-flex; + css={` + .label { + /* Center the content horizontally */ + align-items: center; + display: inline-flex; - /* Cursor */ - cursor: pointer; -} + /* Cursor */ + cursor: pointer; + } -.label__input { - /* Hide it */ - display: none; -} + .label__input { + /* Hide it */ + display: none; + } -.label__square { - border: 1px solid rgba(0, 0, 0, 0.3); - border-radius: 4px; + .label__square { + border: 1px solid rgba(0, 0, 0, 0.3); + border-radius: 4px; - /* Spacing */ - margin-right: 8px; - padding: 4px; -} + /* Spacing */ + margin-right: 8px; + padding: 4px; + } -.label__checkbox { - background-color: transparent; - border-radius: 4px; - height: 16px; - width: 16px; -} + .label__checkbox { + background-color: transparent; + border-radius: 4px; + height: 16px; + width: 16px; + } -.label__checkbox--selected { - /* For selected checkbox */ - background-color: #00449E; -} -`} + .label__checkbox--selected { + /* For selected checkbox */ + background-color: #00449e; + } + `} + > +
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
- -
+
+ + - + ); }; diff --git a/pages/custom-radio-button/index.tsx b/pages/custom-radio-button/index.tsx index 9aded3e..a07bc52 100644 --- a/pages/custom-radio-button/index.tsx +++ b/pages/custom-radio-button/index.tsx @@ -1,14 +1,10 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; @@ -49,9 +45,7 @@ const Details: React.FC<{}> = () => { >
= () => { }; return ( - + -
- @@ -88,95 +81,101 @@ html={` ...
`} -css={` -.label { - /* Center the content horizontally */ - align-items: center; - display: inline-flex; + css={` + .label { + /* Center the content horizontally */ + align-items: center; + display: inline-flex; - /* Cursor */ - cursor: pointer; -} + /* Cursor */ + cursor: pointer; + } -.label__input { - /* Hide it */ - display: none; -} + .label__input { + /* Hide it */ + display: none; + } -.label__circle { - /* Rounded border */ - border: 1px solid rgba(0, 0, 0, 0.3); - border-radius: 9999px; + .label__circle { + /* Rounded border */ + border: 1px solid rgba(0, 0, 0, 0.3); + border-radius: 9999px; - /* Spacing */ - margin-right: 8px; - padding: 4px; -} + /* Spacing */ + margin-right: 8px; + padding: 4px; + } -.label__radio { - /* Rounded border */ - border-radius: 9999px; - height: 16px; - width: 16px; + .label__radio { + /* Rounded border */ + border-radius: 9999px; + height: 16px; + width: 16px; - /* For not selected radio */ - background-color: transparent; -} + /* For not selected radio */ + background-color: transparent; + } -.label__radio--selected { - /* For selected radio */ - background-color: #00449E; -} -`} + .label__radio--selected { + /* For selected radio */ + background-color: #00449e; + } + `} + > +
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+ +
+ +
+
- -
+
+ + - + ); }; diff --git a/pages/diagonal-section/index.tsx b/pages/diagonal-section/index.tsx index b664b24..dc943b0 100644 --- a/pages/diagonal-section/index.tsx +++ b/pages/diagonal-section/index.tsx @@ -1,29 +1,24 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { return ( - + -
-
@@ -32,75 +27,74 @@ html={` ...
`} -css={` -.container { - /* Used to position the diagonal area */ - position: relative; -} + css={` + .container { + /* Used to position the diagonal area */ + position: relative; + } -.container__diagonal { - /* Absolute position */ - left: 0px; - position: absolute; - top: 0px; + .container__diagonal { + /* Absolute position */ + left: 0px; + position: absolute; + top: 0px; - /* Take full size */ - height: 100%; - width: 100%; + /* Take full size */ + height: 100%; + width: 100%; - /* Create diagonal sides */ - transform: skewY(-5deg); + /* Create diagonal sides */ + transform: skewY(-5deg); - /* Background color */ - background-color: rgba(0, 0, 0, 0.3); + /* Background color */ + background-color: rgba(0, 0, 0, 0.3); - /* Displayed under the main content */ - z-index: -1; -} -`} + /* Displayed under the main content */ + z-index: -1; + } + `} + > +
-
-
- -
+ /> +
+
- -
- +
+ + - + ); }; diff --git a/pages/docked-at-corner/index.tsx b/pages/docked-at-corner/index.tsx index 15f139f..c7a7b45 100644 --- a/pages/docked-at-corner/index.tsx +++ b/pages/docked-at-corner/index.tsx @@ -1,30 +1,24 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Heading, Spacer } from '@1milligram/design'; -import Heading from '../../components/Heading'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + -
-
@@ -34,62 +28,64 @@ html={` ...
`} -css={` -.container { - position: relative; -} + css={` + .container { + position: relative; + } -.container__docker { - position: absolute; - right: 0; - top: 0; - transform: translate(50%, -50%); + .container__docker { + position: absolute; + right: 0; + top: 0; + transform: translate(50%, -50%); - /* Center the content */ - align-items: center; - display: flex; - justify-content: center; -} -`} + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; + } + `} + > +
+
- -
-
+ />
- -
+
+
+ + +
- + Use cases
+ - + ); }; diff --git a/pages/dot-leader/index.tsx b/pages/dot-leader/index.tsx index b80b0fe..3ca9b7b 100644 --- a/pages/dot-leader/index.tsx +++ b/pages/dot-leader/index.tsx @@ -1,31 +1,25 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Heading, Spacer } from '@1milligram/design'; -import Heading from '../../components/Heading'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Circle from '../../placeholders/Circle'; import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + -
-
...
@@ -37,80 +31,87 @@ html={`
...
`} -css={` -.container { - /* Center the content */ - align-items: center; - display: flex; - justify-content: center; -} + css={` + .container { + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; + } -.container__dots { - /* Bottom border */ - border-bottom: 1px dotted rgba(0, 0, 0, 0.3); + .container__dots { + /* Bottom border */ + border-bottom: 1px dotted rgba(0, 0, 0, 0.3); - /* Take remaining width */ - flex: 1; + /* Take remaining width */ + flex: 1; - /* Spacing */ - margin: 0px 4px; -} -`} + /* Spacing */ + margin: 0px 4px; + } + `} + > +
-
-
-
-
-
- +
+
+
+
-
-
-
- +
+ +
+
+
+
-
-
-
- +
+ +
+
+
+
+
+
- -
+
+ + +
- + Use cases
@@ -171,8 +172,9 @@ css={`
+ - + ); }; diff --git a/pages/dot-navigation/index.tsx b/pages/dot-navigation/index.tsx index c6140e4..cec851e 100644 --- a/pages/dot-navigation/index.tsx +++ b/pages/dot-navigation/index.tsx @@ -1,13 +1,8 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; interface DotProps { @@ -37,16 +32,15 @@ const Details: React.FC<{}> = () => { }; return ( - + -
-
  • @@ -54,66 +48,65 @@ html={` ...
    `} -css={` -.dots { - /* Center the content */ - align-items: center; - display: flex; - justify-content: center; + css={` + .dots { + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; - /* Reset styles */ - list-style-type: none; - margin: 0; - padding: 0; -} + /* Reset styles */ + list-style-type: none; + margin: 0; + padding: 0; + } -.dots__item { - /* Rounded border */ - border-radius: 9999px; - height: 12px; - width: 12px; + .dots__item { + /* Rounded border */ + border-radius: 9999px; + height: 12px; + width: 12px; - /* Active dot */ - background-color: rgba(0, 0, 0, .3); + /* Active dot */ + background-color: rgba(0, 0, 0, 0.3); - /* Inactive dot */ - background-color: transparent; - border: 1px solid rgba(0, 0, 0, .3); + /* Inactive dot */ + background-color: transparent; + border: 1px solid rgba(0, 0, 0, 0.3); - /* OPTIONAL: Spacing between dots */ - margin: 0 4px; -} -`} + /* OPTIONAL: Spacing between dots */ + margin: 0 4px; + } + `} + > +
    -
    -
      - - - - -
    -
    - -
    -
    + + + + + +
    + + ); }; diff --git a/pages/drawer/index.tsx b/pages/drawer/index.tsx index 7f9081a..f2e67a2 100644 --- a/pages/drawer/index.tsx +++ b/pages/drawer/index.tsx @@ -1,31 +1,23 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { return ( - + -
    -
    - This pattern is also known as off-canvas. -
    - This pattern is also known as off-canvas.
    +
    @@ -36,79 +28,78 @@ html={`
    `} -css={` -.container { - /* Container takes full size */ - height: 100%; - left: 0; - position: fixed; - top: 0; - width: 100%; + css={` + .container { + /* Container takes full size */ + height: 100%; + left: 0; + position: fixed; + top: 0; + width: 100%; - z-index: 9999; -} + z-index: 9999; + } -.container__overlay { - /* Take full size */ - height: 100%; - left: 0; - position: fixed; - top: 0; - width: 100%; + .container__overlay { + /* Take full size */ + height: 100%; + left: 0; + position: fixed; + top: 0; + width: 100%; - /* User still can see the content of main page */ - background-color: rgba(0, 0, 0, 0.5); + /* User still can see the content of main page */ + background-color: rgba(0, 0, 0, 0.5); - z-index: -1; -} + z-index: -1; + } -.container__sidebar { - /* Take full height */ - height: 100%; - left: 0; - position: fixed; - top: 0; - width: 200px; + .container__sidebar { + /* Take full height */ + height: 100%; + left: 0; + position: fixed; + top: 0; + width: 200px; - /* Background */ - background-color: #fff; -} -`} + /* Background */ + background-color: #fff; + } + `} + > +
    +
    -
    -
    - -
    +
    - -
    - +
    + + ); }; diff --git a/pages/drop-area/index.tsx b/pages/drop-area/index.tsx index 11a6943..5df7f1d 100644 --- a/pages/drop-area/index.tsx +++ b/pages/drop-area/index.tsx @@ -1,33 +1,27 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { return ( - + -
    - ...
    `} -css={` + css={` .container { /* Center the content */ align-items: center; @@ -39,37 +33,36 @@ css={` border-radius: 4px; } `} + > +
    -
    -
    - -
    +
    +
    - -
    - +
    + +
    ); }; diff --git a/pages/drop-cap/index.tsx b/pages/drop-cap/index.tsx index e901dfb..61e2dcb 100644 --- a/pages/drop-cap/index.tsx +++ b/pages/drop-cap/index.tsx @@ -1,70 +1,62 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import { Pattern } from '../../constants/Pattern'; const Details: React.FC<{}> = () => { return ( - + -
    - ...
    `} -css={` -/* Styles for the first letter */ -.container:first-letter { - /* Display at the left */ - float: left; - line-height: 1; + css={` + /* Styles for the first letter */ + .container:first-letter { + /* Display at the left */ + float: left; + line-height: 1; - /* Spacing */ - margin: 0 8px 0 0; - padding: 0 8px; + /* Spacing */ + margin: 0 8px 0 0; + padding: 0 8px; - /* Optional */ - font-size: 64px; - font-weight: 700; -} -`} + /* Optional */ + font-size: 64px; + font-weight: 700; + } + `} + > +
    -
    -
    -
    - Cascading Style Sheets (CSS) is a style sheet language used for - describing the presentation of a document written in a markup - language like HTML. CSS is a cornerstone technology of the World Wide Web, - alongside HTML and JavaScript. -
    +
    +
    + Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation + of a document written in a markup language like HTML. CSS is a cornerstone technology of the + World Wide Web, alongside HTML and JavaScript.
    - -
    - +
    + + ); }; diff --git a/pages/dropdown/index.tsx b/pages/dropdown/index.tsx index 10de112..942b630 100644 --- a/pages/dropdown/index.tsx +++ b/pages/dropdown/index.tsx @@ -1,14 +1,10 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; @@ -16,19 +12,18 @@ import Triangle from '../../placeholders/Triangle'; const Details: React.FC<{}> = () => { return ( - + -
    -
    - Move the mouse over the button to see the dropdown. -
    - + Move the mouse over the button to see the dropdown. +
    + @@ -39,108 +34,110 @@ html={`
    `} -css={` -.dropdown { - position: relative; -} + css={` + .dropdown { + position: relative; + } -/* Hide the dropdown's content by default */ -.dropdown__content { - display: none; + /* Hide the dropdown's content by default */ + .dropdown__content { + display: none; - /* Position it right below the trigger element */ - left: 0; - paddingTop: 4px; - position: absolute; - top: 100%; + /* Position it right below the trigger element */ + left: 0; + paddingtop: 4px; + position: absolute; + top: 100%; - /* It should be on the top of other elements */ - background-color: #FFF; - zIndex: 9999; + /* It should be on the top of other elements */ + background-color: #fff; + zindex: 9999; - /* Size */ - height: 200px; - width: 200px; -} + /* Size */ + height: 200px; + width: 200px; + } -/* Show the content when hover on the container */ -.dropdown:hover .dropdown__content { - display: block; -} -`} + /* Show the content when hover on the container */ + .dropdown:hover .dropdown__content { + display: block; + } + `} + > +
    -
    - + +
    +
    - - - - -
    -
    - -
    +
    -
    - -
    - -
    +
    + +
    +
    + + - + ); }; diff --git a/pages/fading-long-section/index.tsx b/pages/fading-long-section/index.tsx index 1a1cfcc..a96c267 100644 --- a/pages/fading-long-section/index.tsx +++ b/pages/fading-long-section/index.tsx @@ -1,31 +1,25 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { return ( - + -
    -
    - Fading a long section to indicate there is more content. -
    - + Fading a long section to indicate there is more content. +
    +
    @@ -36,70 +30,69 @@ html={`
    `} -css={` -.container { - /* Used to position the faded element */ - position: relative; -} + css={` + .container { + /* Used to position the faded element */ + position: relative; + } -.container__content { - /* Height */ - height: 200px; + .container__content { + /* Height */ + height: 200px; - /* Scrollable */ - overflow-y: scroll; -} + /* Scrollable */ + overflow-y: scroll; + } -.container__fading { - /* Displayed at the bottom */ - bottom: 0; - left: 0; - position: absolute; + .container__fading { + /* Displayed at the bottom */ + bottom: 0; + left: 0; + position: absolute; - /* Size */ - height: 30px; - width: 100%; + /* Size */ + height: 30px; + width: 100%; - /* Gradient background */ - background: linear-gradient(rgba(255, 255, 255, 0.01), #fff); -} -`} + /* Gradient background */ + background: linear-gradient(rgba(255, 255, 255, 0.01), #fff); + } + `} + > +
    -
    -
    -
    - -
    - -
    +
    +
    +
    + +
    - -
    - +
    + + ); }; diff --git a/pages/feature-comparison/index.tsx b/pages/feature-comparison/index.tsx index 0f849c1..120c061 100644 --- a/pages/feature-comparison/index.tsx +++ b/pages/feature-comparison/index.tsx @@ -1,14 +1,10 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Circle from '../../placeholders/Circle'; @@ -16,16 +12,15 @@ import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + -
    -
    @@ -48,145 +43,179 @@ html={` ... `} -css={` -.container { - align-items: center; - display: flex; + css={` + .container { + align-items: center; + display: flex; - /* Bottom border */ - border-bottom: 1px solid rgba(0, 0, 0, 0.3); + /* Bottom border */ + border-bottom: 1px solid rgba(0, 0, 0, 0.3); - /* Spacing */ - padding: 12px 0px; -} + /* Spacing */ + padding: 12px 0px; + } -.container__feature { - /* Take available width */ - flex: 1; + .container__feature { + /* Take available width */ + flex: 1; - /* Spacing */ - margin-right: 16px; -} + /* Spacing */ + margin-right: 16px; + } -.container__model { - /* Center the content */ - display: flex; - justify-content: center; + .container__model { + /* Center the content */ + display: flex; + justify-content: center; - /* Spacing */ - margin-right: 16px; -} -`} + /* Spacing */ + margin-right: 16px; + } + `} + > +
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    +
    +
    +
    +
    -
    -
    - -
    -
    - -
    -
    - -
    +
    - -
    -
    - -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    +
    +
    -
    - -
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    +
    + + - + ); }; diff --git a/pages/feature-list/index.tsx b/pages/feature-list/index.tsx index 6749aa2..84da562 100644 --- a/pages/feature-list/index.tsx +++ b/pages/feature-list/index.tsx @@ -1,14 +1,10 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Circle from '../../placeholders/Circle'; @@ -16,16 +12,15 @@ import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + -
    -
    @@ -42,57 +37,64 @@ html={` ... `} -css={` -.container { - display: flex; + css={` + .container { + display: flex; - /* OPTIONAL: Reverse the order of image and content */ - flex-direction: row-reverse; + /* OPTIONAL: Reverse the order of image and content */ + flex-direction: row-reverse; - /* OPTIONAL: Spacing between items */ - margin: 16px 0; -} + /* OPTIONAL: Spacing between items */ + margin: 16px 0; + } -.container__image { - width: 128px; -} + .container__image { + width: 128px; + } -.container__feature { - /* Take the remaining width */ - flex: 1; -} -`} + .container__feature { + /* Take the remaining width */ + flex: 1; + } + `} + > +
    -
    -
    -
    -
    -
    -
    - -
    +
    +
    +
    +
    -
    -
    -
    -
    - +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    + +
    +
    - -
    - +
    + + - + ); }; diff --git a/pages/fixed-at-corner/index.tsx b/pages/fixed-at-corner/index.tsx index 251e237..bc1bf19 100644 --- a/pages/fixed-at-corner/index.tsx +++ b/pages/fixed-at-corner/index.tsx @@ -1,29 +1,24 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Triangle from '../../placeholders/Triangle'; const Details: React.FC<{}> = () => { return ( - + -
    -
    @@ -46,54 +41,54 @@ html={`
    `} -css={` -.container { - position: relative; -} + css={` + .container { + position: relative; + } -.container__corner { - position: absolute; -} + .container__corner { + position: absolute; + } -.container__corner--tl { - left: 0; - top: 0; -} + .container__corner--tl { + left: 0; + top: 0; + } -.container__corner--tr { - top: 0; - right: 0; -} + .container__corner--tr { + top: 0; + right: 0; + } -.container__corner--br { - bottom: 0; - right: 0; -} + .container__corner--br { + bottom: 0; + right: 0; + } -.container__corner--bl { - bottom: 0; - left: 0; -} -`} - > -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    + .container__corner--bl { + bottom: 0; + left: 0; + } + `} + > +
    +
    +
    - -
    +
    + +
    +
    + +
    +
    + +
    +
    + + -
    + ); }; diff --git a/pages/fixed-at-side/index.tsx b/pages/fixed-at-side/index.tsx index a854466..4498ad8 100644 --- a/pages/fixed-at-side/index.tsx +++ b/pages/fixed-at-side/index.tsx @@ -1,67 +1,61 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Heading, Spacer } from '@1milligram/design'; -import Heading from '../../components/Heading'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { return ( - + -
    -
    ...
    `} -css={` -.container { - right: 0; - position: fixed; - top: 50%; - transform: translate(0px, -50%); -} -`} + css={` + .container { + right: 0; + position: fixed; + top: 50%; + transform: translate(0px, -50%); + } + `} + > +
    -
    -
    - -
    + /> +
    +
    +
    - + Use cases
    + - + ); }; diff --git a/pages/floating-label/index.tsx b/pages/floating-label/index.tsx index 88b7725..16b638d 100644 --- a/pages/floating-label/index.tsx +++ b/pages/floating-label/index.tsx @@ -1,32 +1,24 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import './floating-label.css'; - -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import { Pattern } from '../../constants/Pattern'; const Details: React.FC<{}> = () => { return ( - + -
    -
    - Type something in the input to see how the label is shown up. -
    - + Type something in the input to see how the label is shown up. +
    + @@ -35,80 +27,79 @@ html={`
    `} -css={` -.container { - position: relative; -} + css={` + .container { + position: relative; + } -/* + /* Show the label at desired position when the placeholder of input isn't shown */ -.container__input:not(:placeholder-shown) + .container__label { - background: #FFF; - transform: translate(0, -50%); - opacity: 1; -} + .container__input:not(:placeholder-shown) + .container__label { + background: #fff; + transform: translate(0, -50%); + opacity: 1; + } -.container__label { - /* Position the label */ - left: 8px; - position: absolute; - top: 0; + .container__label { + /* Position the label */ + left: 8px; + position: absolute; + top: 0; - /* Hide it by default */ - opacity: 0; - transition: all 200ms; -} -`} + /* Hide it by default */ + opacity: 0; + transition: all 200ms; + } + `} + > +
    -
    +
    + Placeholder +
    - -
    -
    +
    + + ); }; diff --git a/pages/folder-structure/index.tsx b/pages/folder-structure/index.tsx index f450e14..41a402d 100644 --- a/pages/folder-structure/index.tsx +++ b/pages/folder-structure/index.tsx @@ -1,21 +1,17 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Square from '../../placeholders/Square'; import './folder-structure.css'; const Details: React.FC<{}> = () => { return ( - + @@ -23,7 +19,7 @@ const Details: React.FC<{}> = () => {
    • @@ -53,57 +49,59 @@ html={`
    `} -css={` -:root { - --folder-structure-item-height: 1rem; - --folder-structure-item-margin-left: 2rem; - --folder-structure-item-padding-top: 1rem; -} + css={` + :root { + --folder-structure-item-height: 1rem; + --folder-structure-item-margin-left: 2rem; + --folder-structure-item-padding-top: 1rem; + } -.folder-structure ul { - /* Reset */ - list-style-type: none; - margin: 0; -} + .folder-structure ul { + /* Reset */ + list-style-type: none; + margin: 0; + } -.folder-structure li { - padding: var(--folder-structure-item-padding-top) 0rem 0rem 0rem; - position: relative; -} + .folder-structure li { + padding: var(--folder-structure-item-padding-top) 0rem 0rem 0rem; + position: relative; + } -.folder-structure li::before { - border-left: 1px solid rgba(0, 0, 0, .3); - content: ''; - - /* Position */ - left: 0; - position: absolute; - top: 0; - transform: translate(calc(-1 * var(--folder-structure-item-margin-left)), 0); + .folder-structure li::before { + border-left: 1px solid rgba(0, 0, 0, 0.3); + content: ''; - /* Size */ - height: 100%; -} + /* Position */ + left: 0; + position: absolute; + top: 0; + transform: translate(calc(-1 * var(--folder-structure-item-margin-left)), 0); -.folder-structure li::after { - border-bottom: 1px solid rgba(0, 0, 0, .3); - content: ''; + /* Size */ + height: 100%; + } - /* Position */ - left: 0; - position: absolute; - top: calc(var(--folder-structure-item-padding-top) + var(--folder-structure-item-height) / 2); - transform: translate(-100%, 0); + .folder-structure li::after { + border-bottom: 1px solid rgba(0, 0, 0, 0.3); + content: ''; - /* Size */ - width: var(--folder-structure-item-margin-left); -} + /* Position */ + left: 0; + position: absolute; + top: calc(var(--folder-structure-item-padding-top) + var(--folder-structure-item-height) / 2); + transform: translate(-100%, 0); -/* Remove the border from the last item */ -.folder-structure li:last-child::before { - height: calc(var(--folder-structure-item-padding-top) + var(--folder-structure-item-height) / 2); -} -`} + /* Size */ + width: var(--folder-structure-item-margin-left); + } + + /* Remove the border from the last item */ + .folder-structure li:last-child::before { + height: calc( + var(--folder-structure-item-padding-top) + var(--folder-structure-item-height) / 2 + ); + } + `} >
    • - +
        -
      • +
      • + +
    • - +
      • - +
          -
        • -
        • -
        • +
        • + +
        • +
        • + +
        • +
        • + +
      • -
      • - + +
      • +
      • +
          -
        • -
        • +
        • + +
        • +
        • + +
    • -
    • +
    • + +
    + - + ); }; diff --git a/pages/full-background/index.tsx b/pages/full-background/index.tsx index e92b0f2..7ba8e24 100644 --- a/pages/full-background/index.tsx +++ b/pages/full-background/index.tsx @@ -1,80 +1,74 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { return ( - + -
    - ...
    `} -css={` -.container { - /* Center the content */ - align-items: center; - display: flex; - flex-direction: column; - justify-content: center; + css={` + .container { + /* Center the content */ + align-items: center; + display: flex; + flex-direction: column; + justify-content: center; - /* Take full size */ - height: 100vh; - width: 100%; + /* Take full size */ + height: 100vh; + width: 100%; - /* Background */ - background: url('/assets/full-background.jpeg') center center / cover no-repeat; -} -`} + /* Background */ + background: url('/assets/full-background.jpeg') center center / cover no-repeat; + } + `} + > +
    -
    -
    - -
    +
    +
    - -
    - +
    + + -
    + ); }; diff --git a/pages/full-screen-menu/index.tsx b/pages/full-screen-menu/index.tsx index 2695c02..664e94a 100644 --- a/pages/full-screen-menu/index.tsx +++ b/pages/full-screen-menu/index.tsx @@ -1,28 +1,22 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + -
    -
    `} -css={` -.container { - /* Full screen overlay */ - height: 100%; - left: 0; - position: fixed; - top: 0; - width: 100%; + css={` + .container { + /* Full screen overlay */ + height: 100%; + left: 0; + position: fixed; + top: 0; + width: 100%; - /* Center the content */ - align-items: center; - display: flex; - justify-content: center; -} + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; + } -.container__close { - /* Shown at top right corner */ - position: absolute; - right: 16px; - top: 16px; -} -`} + .container__close { + /* Shown at top right corner */ + position: absolute; + right: 16px; + top: 16px; + } + `} + > +
    +
    - -
    -
      -
    • -
    • -
    • -
    • -
    -
    +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
    - -
    -
    +
    + + ); }; diff --git a/pages/holy-grail/index.tsx b/pages/holy-grail/index.tsx index 5114ba5..34388ed 100644 --- a/pages/holy-grail/index.tsx +++ b/pages/holy-grail/index.tsx @@ -1,29 +1,23 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + -
    -
    ... @@ -43,87 +37,90 @@ html={`
    `} -css={` -.container { - display: flex; - flex-direction: column; -} + css={` + .container { + display: flex; + flex-direction: column; + } -.container__main { - /* Take the remaining height */ - flex-grow: 1; + .container__main { + /* Take the remaining height */ + flex-grow: 1; - /* Layout the left sidebar, main content and right sidebar */ - display: flex; - flex-direction: row; -} + /* Layout the left sidebar, main content and right sidebar */ + display: flex; + flex-direction: row; + } -.container__left { - width: 25%; -} + .container__left { + width: 25%; + } -.container__middle { - /* Take the remaining width */ - flex-grow: 1; -} + .container__middle { + /* Take the remaining width */ + flex-grow: 1; + } -.container__right { - width: 20%; -} -`} + .container__right { + width: 20%; + } + `} + > +
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    +
    +
    - -
    - +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    +
    + +
    ); }; diff --git a/pages/index.tsx b/pages/index.tsx index 0b611cd..838d6f5 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -17,7 +17,9 @@ const HomePage = () => {
    Following covers are made with CSS only. Inspect them!
    -
    Display
    +
    + Display +
    @@ -74,7 +76,9 @@ const HomePage = () => {
    -
    Feedback
    +
    + Feedback +
    @@ -86,8 +90,10 @@ const HomePage = () => {
    - -
    Input
    + +
    + Input +
    @@ -107,7 +113,9 @@ const HomePage = () => {
    -
    Layout
    +
    + Layout +
    @@ -121,7 +129,9 @@ const HomePage = () => {
    -
    Navigation
    +
    + Navigation +
    diff --git a/pages/initial-avatar/index.tsx b/pages/initial-avatar/index.tsx index 733adfd..730e179 100644 --- a/pages/initial-avatar/index.tsx +++ b/pages/initial-avatar/index.tsx @@ -1,33 +1,31 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Link } from 'react-router-dom'; +import Link from 'next/link'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { return ( - + -
    -
    - To center the content, you also can use other technique demonstrated in - the Centering pattern. -
    - + To center the content, you also can use other technique demonstrated in the{' '} + + Centering + {' '} + pattern. +
    +
    @@ -35,71 +33,72 @@ html={`
    `} -css={` -.avatar { - /* Center the content */ - display: inline-block; - vertical-align: middle; + css={` + .avatar { + /* Center the content */ + display: inline-block; + vertical-align: middle; - /* Used to position the content */ - position: relative; + /* Used to position the content */ + position: relative; - /* Colors */ - background-color: rgba(0, 0, 0, .3); - color: #FFF; + /* Colors */ + background-color: rgba(0, 0, 0, 0.3); + color: #fff; - /* Rounded border */ - border-radius: 50%; - height: 48px; - width: 48px; -} + /* Rounded border */ + border-radius: 50%; + height: 48px; + width: 48px; + } -.avatar__letters { - /* Center the content */ - left: 50%; - position: absolute; - top: 50%; - transform: translate(-50%, -50%); -} -`} + .avatar__letters { + /* Center the content */ + left: 50%; + position: absolute; + top: 50%; + transform: translate(-50%, -50%); + } + `} + > +
    -
    - PN -
    + PN
    - -
    +
    + + + -
    + ); }; diff --git a/pages/input-addon/index.tsx b/pages/input-addon/index.tsx index a9f1ee0..3328b33 100644 --- a/pages/input-addon/index.tsx +++ b/pages/input-addon/index.tsx @@ -1,28 +1,22 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + -
    -
    @@ -61,153 +55,152 @@ html={`
    `} -css={` -.container { - display: flex; + css={` + .container { + display: flex; - /* Take full size */ - width: 100%; -} + /* Take full size */ + width: 100%; + } -.container__input { - /* Take the remaining width */ - flex: 1; -} + .container__input { + /* Take the remaining width */ + flex: 1; + } -.container__addon { - /* Center the content */ - align-items: center; - display: flex; - justify-content: center; -} -`} + .container__addon { + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; + } + `} + > +
    -
    -
    +
    +
    -
    - -
    - +
    + +
    +
    +
    - -
    - -
    +
    +
    +
    -
    - -
    - -
    - -
    + +
    + +
    +
    - -
    - +
    + + ); }; diff --git a/pages/inverted-corners/index.tsx b/pages/inverted-corners/index.tsx index 8872413..403f33d 100644 --- a/pages/inverted-corners/index.tsx +++ b/pages/inverted-corners/index.tsx @@ -1,22 +1,17 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Heading, Spacer } from '@1milligram/design'; -import Heading from '../../components/Heading'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import './inverted-corners.css'; const Details: React.FC<{}> = () => { return ( - + @@ -24,43 +19,43 @@ const Details: React.FC<{}> = () => { ...
    `} -css={` -:root { - --inverted-corners-background: #52525B; - --inverted-corners-size: 2rem; -} + css={` + :root { + --inverted-corners-background: #52525b; + --inverted-corners-size: 2rem; + } -.inverted-corners { - background-color: var(--inverted-corners-background); + .inverted-corners { + background-color: var(--inverted-corners-background); - /* Used to position the corner */ - position: relative; -} + /* Used to position the corner */ + position: relative; + } -.inverted-corners::before { - content: ''; + .inverted-corners::before { + content: ''; - /* Absolute position */ - bottom: calc(-2 * var(--inverted-corners-size)); - left: 0; - position: absolute; + /* Absolute position */ + bottom: calc(-2 * var(--inverted-corners-size)); + left: 0; + position: absolute; - /* Size */ - height: calc(2 * var(--inverted-corners-size)); - width: var(--inverted-corners-size); + /* Size */ + height: calc(2 * var(--inverted-corners-size)); + width: var(--inverted-corners-size); - /* Border */ - background-color: transparent; - border-top-left-radius: var(--inverted-corners-size); - box-shadow: var(--inverted-corners-background) - 0px calc(-1 * var(--inverted-corners-size)) 0px 0px; -} -`} + /* Border */ + background-color: transparent; + border-top-left-radius: var(--inverted-corners-size); + box-shadow: var(--inverted-corners-background) 0px calc(-1 * var(--inverted-corners-size)) 0px + 0px; + } + `} >
    -
    +
    + +
    - + Use cases
    -
    Speech Bubble
    +
    Speech Bubble
    + - + ); }; diff --git a/pages/keyboard-shortcut/index.tsx b/pages/keyboard-shortcut/index.tsx index 6abe5c2..c478027 100644 --- a/pages/keyboard-shortcut/index.tsx +++ b/pages/keyboard-shortcut/index.tsx @@ -1,15 +1,10 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Link } from 'react-router-dom'; +import Link from 'next/link'; +import { Heading, Spacer } from '@1milligram/design'; -import Heading from '../../components/Heading'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; interface ItemProps { @@ -46,71 +41,72 @@ const Item: React.FC = ({ action, keys }) => { const Details: React.FC<{}> = () => { return ( - + -
    -
    - We use the native kbd tag to display the keyboard shortcut. -
    - + We use the native kbd tag to display the keyboard shortcut. +
    + ... `} -css={` -.container { - /* Background and color */ - background-color: rgba(0, 0, 0, 0.1); - border-radius: 4px; - color: rgba(0, 0, 0, 0.7); + css={` + .container { + /* Background and color */ + background-color: rgba(0, 0, 0, 0.1); + border-radius: 4px; + color: rgba(0, 0, 0, 0.7); - /* Bottom shadow */ - box-shadow: rgba(0, 0, 0, 0.3) 0px -2px 0px inset, - rgba(0, 0, 0, 0.4) 0px 1px 1px; + /* Bottom shadow */ + box-shadow: rgba(0, 0, 0, 0.3) 0px -2px 0px inset, rgba(0, 0, 0, 0.4) 0px 1px 1px; - /* Spacing */ - padding: 8px; -} -`} + /* Spacing */ + padding: 8px; + } + `} + > +
    -
    - - ⌘ + C - -
    - -
    + ⌘ + C + +
    + +
    - + Use cases
    - We can use this pattern with the property list pattern - to create shortkey preferences as following: + We can use this pattern with the{' '} + + property list + {' '} + pattern to create shortkey preferences as following:
    @@ -119,7 +115,7 @@ css={`
    - + ); }; diff --git a/pages/layered-card/index.tsx b/pages/layered-card/index.tsx index f906f7f..31d2551 100644 --- a/pages/layered-card/index.tsx +++ b/pages/layered-card/index.tsx @@ -1,20 +1,16 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import './styles.css'; const Details: React.FC<{}> = () => { return ( - + @@ -22,35 +18,35 @@ const Details: React.FC<{}> = () => { ...
    `} -css={` -.layered-card { - position: relative; -} + css={` + .layered-card { + position: relative; + } -.layered-card::before { - background: rgba(0, 0, 0, 0.3); - content: ''; - - /* Position */ - top: 0; - left: 0; - position: absolute; - transform: translate(1rem, 1rem); + .layered-card::before { + background: rgba(0, 0, 0, 0.3); + content: ''; - /* Size */ - height: 100%; - width: 100%; + /* Position */ + top: 0; + left: 0; + position: absolute; + transform: translate(1rem, 1rem); - /* Display under the main content */ - z-index: -1; -} -`} - > + /* Size */ + height: 100%; + width: 100%; + + /* Display under the main content */ + z-index: -1; + } + `} + >
    + - + ); }; diff --git a/pages/lined-paper/index.tsx b/pages/lined-paper/index.tsx index f7b9eec..465cdd7 100644 --- a/pages/lined-paper/index.tsx +++ b/pages/lined-paper/index.tsx @@ -1,78 +1,70 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { return ( - + -
    - ...
    `} -css={` -.container { - /* Lined background */ - background-image: linear-gradient(rgba(0, 0, 0, 0.3) 1px, transparent 0px); - background-size: 100% 2em; + css={` + .container { + /* Lined background */ + background-image: linear-gradient(rgba(0, 0, 0, 0.3) 1px, transparent 0px); + background-size: 100% 2em; - /* + /* Display the content on top of the lines. The line height must be the same as the background size defined above */ - background-position-y: 24px; - line-height: 2em; -} -`} + background-position-y: 24px; + line-height: 2em; + } + `} + > +
    -
    -
    - Cascading Style Sheets (CSS) is a style sheet language used for - describing the presentation of a document written in a markup - language like HTML. CSS is a cornerstone technology of the World Wide Web, - alongside HTML and JavaScript. -
    -
    — Wikipedia
    +
    + Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation + of a document written in a markup language like HTML. CSS is a cornerstone technology of the + World Wide Web, alongside HTML and JavaScript.
    +
    — Wikipedia
    - -
    - +
    + +
    ); }; diff --git a/pages/masonry-grid/index.tsx b/pages/masonry-grid/index.tsx index e90c6c2..37ef354 100644 --- a/pages/masonry-grid/index.tsx +++ b/pages/masonry-grid/index.tsx @@ -1,14 +1,10 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; @@ -16,7 +12,7 @@ import './masonry-grid.css'; const Details: React.FC<{}> = () => { return ( - + @@ -24,7 +20,7 @@ const Details: React.FC<{}> = () => {
    ...
    @@ -32,26 +28,26 @@ html={`
    `} -css={` -.masonry-grid { - /* It is split into 3 columns */ - column-count: 3; + css={` + .masonry-grid { + /* It is split into 3 columns */ + column-count: 3; - /* The space between columns */ - column-gap: 1rem; + /* The space between columns */ + column-gap: 1rem; - /* Misc */ - width: 100%; -} + /* Misc */ + width: 100%; + } -.masonry-grid__item { - /* Prevent a column from breaking into multiple columns */ - break-inside: avoid; + .masonry-grid__item { + /* Prevent a column from breaking into multiple columns */ + break-inside: avoid; - /* Misc */ - margin-bottom: 1rem; -} -`} + /* Misc */ + margin-bottom: 1rem; + } + `} >
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    + - + ); }; diff --git a/pages/media-object/index.tsx b/pages/media-object/index.tsx index bf2c2ec..fd0b134 100644 --- a/pages/media-object/index.tsx +++ b/pages/media-object/index.tsx @@ -1,13 +1,8 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; @@ -15,16 +10,15 @@ import Square from '../../placeholders/Square'; const Details: React.FC<{}> = () => { return ( - + -
    -
    @@ -37,48 +31,51 @@ html={`
    `} -css={` -.container { - /* Align sub-items to top */ - align-items: start; - display: flex; -} + css={` + .container { + /* Align sub-items to top */ + align-items: start; + display: flex; + } -.container__media { - margin-right: 16px; + .container__media { + margin-right: 16px; - /* Set the width for the media object */ - width: 200px; -} + /* Set the width for the media object */ + width: 200px; + } -.container__content { - /* Take the remaining width */ - flex: 1; -} -`} + .container__content { + /* Take the remaining width */ + flex: 1; + } + `} + > +
    -
    -
    - +
    + +
    +
    +
    +
    -
    -
    - -
    -
    -
    +
    + +
    +
    +
    - -
    - +
    + + ); }; diff --git a/pages/mega-menu/index.tsx b/pages/mega-menu/index.tsx index aa99747..52a0be3 100644 --- a/pages/mega-menu/index.tsx +++ b/pages/mega-menu/index.tsx @@ -1,16 +1,10 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; - -import './mega-menu.css'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; @@ -18,19 +12,18 @@ import Triangle from '../../placeholders/Triangle'; const Details: React.FC<{}> = () => { return ( - + -
    -
    - Move the mouse over the second navigation item to see the mega menu. -
    - + Move the mouse over the second navigation item to see the mega menu. +
    + ... @@ -47,106 +40,107 @@ html={`
    `} -css={` -.container { - /* Used to position the mega menu */ - position: relative; -} + css={` + .container { + /* Used to position the mega menu */ + position: relative; + } -.container__trigger:hover .container__content { - /* Show the mega menu when hovering the trigger item */ - display: block; -} + .container__trigger:hover .container__content { + /* Show the mega menu when hovering the trigger item */ + display: block; + } -.container__content { - /* Border */ - border: 1px solid rgba(0, 0, 0, 0.3); - margin-top: -1px; + .container__content { + /* Border */ + border: 1px solid rgba(0, 0, 0, 0.3); + margin-top: -1px; - /* Hidden by default */ - display: none; + /* Hidden by default */ + display: none; - /* Absolute position */ - left: 0px; - position: absolute; - top: 100%; + /* Absolute position */ + left: 0px; + position: absolute; + top: 100%; - /* Take full width */ - width: 100%; + /* Take full width */ + width: 100%; - /* Displayed on top of other elements */ - background: #fff; - z-index: 9999; -} -`} - > -
    -
    + /* Displayed on top of other elements */ + background: #fff; + z-index: 9999; + } + `} + > +
    +
    +
    -
    - -
    -
    -
    -
    - + +
    +
    +
    +
    +
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    -
    - -
    +
    +
    +
    - -
    - -
    - -
    +
    + +
    +
    + + - + ); }; diff --git a/pages/menu/index.tsx b/pages/menu/index.tsx index f5fda6d..380a848 100644 --- a/pages/menu/index.tsx +++ b/pages/menu/index.tsx @@ -1,32 +1,25 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; - -import './menu.css'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Circle from '../../placeholders/Circle'; import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + -
    - `} -css={` -.menu { - display: flex; - flex-direction: column; + css={` + .menu { + display: flex; + flex-direction: column; - /* Border */ - border: 1px solid rgba(0, 0, 0, 0.3); - border-radius: 4px; -} + /* Border */ + border: 1px solid rgba(0, 0, 0, 0.3); + border-radius: 4px; + } -.menu__item { - /* Center the content horizontally */ - align-items: center; - display: flex; -} + .menu__item { + /* Center the content horizontally */ + align-items: center; + display: flex; + } -.menu__hotkey { - /* Push the hot key to the right */ - margin-left: auto; -} + .menu__hotkey { + /* Push the hot key to the right */ + margin-left: auto; + } -.menu__divider { - border-bottom: 1px solid rgba(0, 0, 0, 0.3); - height: 1px; -} -`} + .menu__divider { + border-bottom: 1px solid rgba(0, 0, 0, 0.3); + height: 1px; + } + `} + > +
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    Ctrl + X
    -
    -
    -
    -
    Ctrl + C
    -
    -
    -
    - -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    Ctrl + V
    +
    +
    +
    + +
    + +
    +
    +
    +
    + +
    +
    Ctrl + X
    +
    +
    +
    + +
    +
    Ctrl + C
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    Ctrl + V
    +
    - -
    +
    + + + + - + ); }; diff --git a/pages/modal/index.tsx b/pages/modal/index.tsx index ee38a2c..e5c0ca8 100644 --- a/pages/modal/index.tsx +++ b/pages/modal/index.tsx @@ -1,14 +1,9 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Link } from 'react-router-dom'; -import { Pattern } from '../../constants/Pattern'; +import Link from 'next/link'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Circle from '../../placeholders/Circle'; @@ -16,20 +11,22 @@ import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + -
    -
    - You can use the close button to - represent the button for closing the modal. -
    - + You can use the{' '} + + close button + {' '} + to represent the button for closing the modal. +
    +
    `} -css={` -.modal { - /* Border */ - border: 1px solid rgba(0, 0, 0.3); - border-radius: 4px; -} + css={` + .modal { + /* Border */ + border: 1px solid rgba(0, 0, 0.3); + border-radius: 4px; + } -.modal__header { - display: flex; - justify-content: space-between; - /* Border */ - border-bottom: 1px solid rgba(0, 0, 0.3); -} + .modal__header { + display: flex; + justify-content: space-between; + /* Border */ + border-bottom: 1px solid rgba(0, 0, 0.3); + } -.modal__footer { - display: flex; - /* Push the buttons to the right */ - justify-content: flex-end; - /* Border */ - border-top: 1px solid rgba(0, 0, 0.3); -} -`} + .modal__footer { + display: flex; + /* Push the buttons to the right */ + justify-content: flex-end; + /* Border */ + border-top: 1px solid rgba(0, 0, 0.3); + } + `} + > +
    -
    -
    -
    - -
    +
    +
    -
    -
    - +
    +
    -
    -
    -
    +
    +
    +
    + +
    + +
    +
    +
    + +
    +
    +
    - -
    - +
    + + ); }; diff --git a/pages/nested-dropdowns/index.tsx b/pages/nested-dropdowns/index.tsx index 3c4d8ec..d3a08d9 100644 --- a/pages/nested-dropdowns/index.tsx +++ b/pages/nested-dropdowns/index.tsx @@ -1,33 +1,29 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; - -import './nested-dropdowns.css'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { return ( - + - + -
    -
    - Hover on the Patterns → Navigation to see the sub dropdowns. -
    - + Hover on the Patterns → Navigation to see the sub dropdowns. +
    +
  • Home
  • @@ -54,100 +50,99 @@ html={`
  • About
  • `} -css={` -.dropdown { - /* Border */ - border: 1px solid rgba(0, 0, 0, 0.3); - display: flex; + css={` + .dropdown { + /* Border */ + border: 1px solid rgba(0, 0, 0, 0.3); + display: flex; - /* Reset list styles */ - list-style-type: none; - margin: 0; - padding: 0; -} + /* Reset list styles */ + list-style-type: none; + margin: 0; + padding: 0; + } -.dropdown li { - /* Spacing */ - padding: 8px; + .dropdown li { + /* Spacing */ + padding: 8px; - /* Used to position the sub dropdown */ - position: relative; -} + /* Used to position the sub dropdown */ + position: relative; + } -/* The sub dropdown */ -.dropdown ul { - /* Border */ - border: 1px solid rgba(0, 0, 0, 0.3); + /* The sub dropdown */ + .dropdown ul { + /* Border */ + border: 1px solid rgba(0, 0, 0, 0.3); - /* Hidden by default */ - display: none; + /* Hidden by default */ + display: none; - /* Absolute position */ - left: 0; - position: absolute; - top: 100%; + /* Absolute position */ + left: 0; + position: absolute; + top: 100%; - /* Reset styles */ - list-style-type: none; - margin: 0; - padding: 0; + /* Reset styles */ + list-style-type: none; + margin: 0; + padding: 0; - /* Width */ - width: 200px; -} + /* Width */ + width: 200px; + } -/* The second level sub dropdown */ -.dropdown ul ul { - left: 100%; - position: absolute; - top: 0; -} + /* The second level sub dropdown */ + .dropdown ul ul { + left: 100%; + position: absolute; + top: 0; + } -/* Change background color of list item when being hovered */ -.dropdown li:hover { - background-color: rgba(0, 0, 0, 0.1); -} + /* Change background color of list item when being hovered */ + .dropdown li:hover { + background-color: rgba(0, 0, 0, 0.1); + } -/* Show the direct sub dropdown when hovering the list item */ -.dropdown li:hover > ul { - display: block; -} -`} + /* Show the direct sub dropdown when hovering the list item */ + .dropdown li:hover > ul { + display: block; + } + `} + > +
    -
    -
      -
    • Home
    • -
    • -
      Patterns
      -
        -
      • Layout
      • -
      • Input
      • -
      • -
        Navigation
        -
          -
        • Breadcrumb
        • -
        • Dropdown
        • -
        • Menu
        • -
        • Nested dropdown
        • -
        -
      • -
      • Display
      • -
      • Feedback
      • -
      -
    • -
    • Products
    • -
    • About
    • -
    -
    - -
    - +
      +
    • Home
    • +
    • +
      Patterns
      +
        +
      • Layout
      • +
      • Input
      • +
      • +
        Navigation
        +
          +
        • Breadcrumb
        • +
        • Dropdown
        • +
        • Menu
        • +
        • Nested dropdown
        • +
        +
      • +
      • Display
      • +
      • Feedback
      • +
      +
    • +
    • Products
    • +
    • About
    • +
    +
    + + - + ); }; diff --git a/pages/notification/index.tsx b/pages/notification/index.tsx index 0a7f01e..5d7a6e9 100644 --- a/pages/notification/index.tsx +++ b/pages/notification/index.tsx @@ -1,34 +1,31 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Link } from 'react-router-dom'; -import { Pattern } from '../../constants/Pattern'; +import Link from 'next/link'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Circle from '../../placeholders/Circle'; const Details: React.FC<{}> = () => { return ( - + -
    -
    - You can use the close button to - represent the button for closing the notification. -
    - + You can use the{' '} + + close button + {' '} + to represent the button for closing the notification. +
    + ... @@ -37,53 +34,54 @@ html={` ...
    `} -css={` -.notification { - display: flex; - justify-content: space-between; -} -`} + css={` + .notification { + display: flex; + justify-content: space-between; + } + `} + > +
    -
    + +
    + -
    + +
    - -
    - +
    + +
    ); }; diff --git a/pages/overlay-play-button/index.tsx b/pages/overlay-play-button/index.tsx index 0cd0cf5..5c11427 100644 --- a/pages/overlay-play-button/index.tsx +++ b/pages/overlay-play-button/index.tsx @@ -1,29 +1,24 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Triangle from '../../placeholders/Triangle'; const Details: React.FC<{}> = () => { return ( - + -
    -
    `} -css={` -.container { - /* Used to position the overlay */ - position: relative; -} + css={` + .container { + /* Used to position the overlay */ + position: relative; + } -.container__overlay { - /* Position */ - left: 0; - position: absolute; - top: 0; + .container__overlay { + /* Position */ + left: 0; + position: absolute; + top: 0; - /* Take full size */ - height: 100%; - width: 100%; + /* Take full size */ + height: 100%; + width: 100%; - /* Center the content */ - align-items: center; - display: flex; - justify-content: center; + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; - /* Add a dark background */ - background-color: rgba(0, 0, 0, 0.25); -} -`} + /* Add a dark background */ + background-color: rgba(0, 0, 0, 0.25); + } + `} + > +
    -
    - -
    +
    - -
    +
    + + - + ); }; diff --git a/pages/pagination/index.tsx b/pages/pagination/index.tsx index 28c4780..258ad72 100644 --- a/pages/pagination/index.tsx +++ b/pages/pagination/index.tsx @@ -1,29 +1,23 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Circle from '../../placeholders/Circle'; import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + -
    -
    @@ -34,119 +28,118 @@ html={` ...
    `} -css={` -.pagination { - display: flex; + css={` + .pagination { + display: flex; - /* Border */ - border: 1px solid rgba(0, 0, 0, 0.3); - border-radius: 4px; -} + /* Border */ + border: 1px solid rgba(0, 0, 0, 0.3); + border-radius: 4px; + } -.pagination__item { - /* Center the content */ - align-items: center; - display: flex; - justify-content: center; + .pagination__item { + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; - /* Right border */ - border-right: 1px solid rgba(0, 0, 0, 0.3); -} -.pagination__item + .pagination__item { - /* No right border */ - border-right: none; -} -`} + /* Right border */ + border-right: 1px solid rgba(0, 0, 0, 0.3); + } + .pagination__item + .pagination__item { + /* No right border */ + border-right: none; + } + `} + > +
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    - -
    - +
    + +
    ); }; diff --git a/pages/popover-arrow/index.tsx b/pages/popover-arrow/index.tsx index 9603cf8..76762e1 100644 --- a/pages/popover-arrow/index.tsx +++ b/pages/popover-arrow/index.tsx @@ -1,28 +1,23 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { return ( - + -
    - ... @@ -64,343 +59,342 @@ html={`
    `} -css={` -.container { - /* Border */ - border: 1px solid rgba(0, 0, 0, 0.3); + css={` + .container { + /* Border */ + border: 1px solid rgba(0, 0, 0, 0.3); - /* Used to position the arrow */ - position: relative; -} + /* Used to position the arrow */ + position: relative; + } -.container__arrow { - /* Size */ - height: 16px; - width: 16px; + .container__arrow { + /* Size */ + height: 16px; + width: 16px; - background-color: #FFF; - position: absolute; -} + background-color: #fff; + position: absolute; + } -.container__arrow--tl { - /* Position at the top left corner */ - left: 32px; - top: 0px; + .container__arrow--tl { + /* Position at the top left corner */ + left: 32px; + top: 0px; - /* Border */ - border-left: 1px solid rgba(0, 0, 0, 0.3); - border-top: 1px solid rgba(0, 0, 0, 0.3); - transform: translate(50%, -50%) rotate(45deg); -} + /* Border */ + border-left: 1px solid rgba(0, 0, 0, 0.3); + border-top: 1px solid rgba(0, 0, 0, 0.3); + transform: translate(50%, -50%) rotate(45deg); + } -.container__arrow--tc { - /* Position at the top center */ - left: 50%; - top: 0px; + .container__arrow--tc { + /* Position at the top center */ + left: 50%; + top: 0px; - /* Border */ - border-left: 1px solid rgba(0, 0, 0, 0.3); - border-top: 1px solid rgba(0, 0, 0, 0.3); - transform: translate(-50%, -50%) rotate(45deg); -} + /* Border */ + border-left: 1px solid rgba(0, 0, 0, 0.3); + border-top: 1px solid rgba(0, 0, 0, 0.3); + transform: translate(-50%, -50%) rotate(45deg); + } -.container__arrow--tr { - /* Position at the top right corner */ - right: 32px; - top: 0px; + .container__arrow--tr { + /* Position at the top right corner */ + right: 32px; + top: 0px; - /* Border */ - border-left: 1px solid rgba(0, 0, 0, 0.3); - border-top: 1px solid rgba(0, 0, 0, 0.3); - transform: translate(-50%, -50%) rotate(45deg); -} + /* Border */ + border-left: 1px solid rgba(0, 0, 0, 0.3); + border-top: 1px solid rgba(0, 0, 0, 0.3); + transform: translate(-50%, -50%) rotate(45deg); + } -.container__arrow--rt { - /* Position at the right top corner */ - right: 0; - top: 32px; + .container__arrow--rt { + /* Position at the right top corner */ + right: 0; + top: 32px; - /* Border */ - border-right: 1px solid rgba(0, 0, 0, 0.3); - border-top: 1px solid rgba(0, 0, 0, 0.3); - transform: translate(50%, 50%) rotate(45deg); -} + /* Border */ + border-right: 1px solid rgba(0, 0, 0, 0.3); + border-top: 1px solid rgba(0, 0, 0, 0.3); + transform: translate(50%, 50%) rotate(45deg); + } -.container__arrow--rc { - /* Position at the right center */ - right: 0; - top: 50%; + .container__arrow--rc { + /* Position at the right center */ + right: 0; + top: 50%; - /* Border */ - border-right: 1px solid rgba(0, 0, 0, 0.3); - border-top: 1px solid rgba(0, 0, 0, 0.3); - transform: translate(50%, -50%) rotate(45deg); -} + /* Border */ + border-right: 1px solid rgba(0, 0, 0, 0.3); + border-top: 1px solid rgba(0, 0, 0, 0.3); + transform: translate(50%, -50%) rotate(45deg); + } -.container__arrow--rb { - /* Position at the right bottom corner */ - bottom: 32px; - right: 0; + .container__arrow--rb { + /* Position at the right bottom corner */ + bottom: 32px; + right: 0; - /* Border */ - border-right: 1px solid rgba(0, 0, 0, 0.3); - border-top: 1px solid rgba(0, 0, 0, 0.3); - transform: translate(50%, -50%) rotate(45deg); -} + /* Border */ + border-right: 1px solid rgba(0, 0, 0, 0.3); + border-top: 1px solid rgba(0, 0, 0, 0.3); + transform: translate(50%, -50%) rotate(45deg); + } -.container__arrow--bl { - /* Position at the bottom left corner */ - bottom: -16px; - left: 32px; + .container__arrow--bl { + /* Position at the bottom left corner */ + bottom: -16px; + left: 32px; - /* Border */ - border-bottom: 1px solid rgba(0, 0, 0, 0.3); - border-right: 1px solid rgba(0, 0, 0, 0.3); - transform: translate(50%, -50%) rotate(45deg); -} + /* Border */ + border-bottom: 1px solid rgba(0, 0, 0, 0.3); + border-right: 1px solid rgba(0, 0, 0, 0.3); + transform: translate(50%, -50%) rotate(45deg); + } -.container__arrow--bc { - /* Position at the bottom center */ - bottom: -16px; - left: 50%; + .container__arrow--bc { + /* Position at the bottom center */ + bottom: -16px; + left: 50%; - /* Border */ - border-bottom: 1px solid rgba(0, 0, 0, 0.3); - border-right: 1px solid rgba(0, 0, 0, 0.3); - transform: translate(-50%, -50%) rotate(45deg); -} + /* Border */ + border-bottom: 1px solid rgba(0, 0, 0, 0.3); + border-right: 1px solid rgba(0, 0, 0, 0.3); + transform: translate(-50%, -50%) rotate(45deg); + } -.container__arrow--br { - /* Position at the bottom right corner */ - bottom: -16px; - right: 32px; + .container__arrow--br { + /* Position at the bottom right corner */ + bottom: -16px; + right: 32px; - /* Border */ - border-bottom: 1px solid rgba(0, 0, 0, 0.3); - border-right: 1px solid rgba(0, 0, 0, 0.3); - transform: translate(-50%, -50%) rotate(45deg); -} + /* Border */ + border-bottom: 1px solid rgba(0, 0, 0, 0.3); + border-right: 1px solid rgba(0, 0, 0, 0.3); + transform: translate(-50%, -50%) rotate(45deg); + } -.container__arrow--lt { - /* Position at the left top corner */ - left: 0; - top: 32px; + .container__arrow--lt { + /* Position at the left top corner */ + left: 0; + top: 32px; - /* Border */ - border-bottom: 1px solid rgba(0, 0, 0, 0.3); - border-left: 1px solid rgba(0, 0, 0, 0.3); - transform: translate(-50%, 50%) rotate(45deg); -} + /* Border */ + border-bottom: 1px solid rgba(0, 0, 0, 0.3); + border-left: 1px solid rgba(0, 0, 0, 0.3); + transform: translate(-50%, 50%) rotate(45deg); + } -.container__arrow--lc { - /* Position at the left center */ - left: 0; - top: 50%; + .container__arrow--lc { + /* Position at the left center */ + left: 0; + top: 50%; - /* Border */ - border-bottom: 1px solid rgba(0, 0, 0, 0.3); - border-left: 1px solid rgba(0, 0, 0, 0.3); - transform: translate(-50%, -50%) rotate(45deg); -} + /* Border */ + border-bottom: 1px solid rgba(0, 0, 0, 0.3); + border-left: 1px solid rgba(0, 0, 0, 0.3); + transform: translate(-50%, -50%) rotate(45deg); + } -.container__arrow--lb { - /* Position at the left bottom corner */ - bottom: 32px; - left: 0; + .container__arrow--lb { + /* Position at the left bottom corner */ + bottom: 32px; + left: 0; - /* Border */ - border-bottom: 1px solid rgba(0, 0, 0, 0.3); - border-left: 1px solid rgba(0, 0, 0, 0.3); - transform: translate(-50%, -50%) rotate(45deg); -} -`} + /* Border */ + border-bottom: 1px solid rgba(0, 0, 0, 0.3); + border-left: 1px solid rgba(0, 0, 0, 0.3); + transform: translate(-50%, -50%) rotate(45deg); + } + `} + > +
    -
    -
    -
    + /> +
    +
    -
    -
    -
    +
    +
    +
    -
    -
    -
    +
    +
    +
    -
    -
    -
    -
    +
    +
    +
    - -
    - +
    + + - + ); }; diff --git a/pages/presence-indicator/index.tsx b/pages/presence-indicator/index.tsx index 13c0cb4..0454afa 100644 --- a/pages/presence-indicator/index.tsx +++ b/pages/presence-indicator/index.tsx @@ -1,29 +1,24 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Circle from '../../placeholders/Circle'; const Details: React.FC<{}> = () => { return ( - + -
    - ... @@ -32,7 +27,7 @@ html={`
    `} -css={` + css={` .container { position: relative; } @@ -53,46 +48,47 @@ css={` background-color: #FF4136; } `} + > +
    +
    - -
    -
    + />
    - -
    +
    + + + -
    + ); }; diff --git a/pages/previous-next-buttons/index.tsx b/pages/previous-next-buttons/index.tsx index 9e9f720..a3db379 100644 --- a/pages/previous-next-buttons/index.tsx +++ b/pages/previous-next-buttons/index.tsx @@ -1,28 +1,22 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + -
    - .. @@ -31,67 +25,66 @@ html={` ..
    `} -css={` -.container { - align-items: center; - display: flex; - justify-content: space-between; -} -`} + css={` + .container { + align-items: center; + display: flex; + justify-content: space-between; + } + `} + > +
    -
    - - -
    - +
    + +
    ); }; diff --git a/pages/price-tag/index.tsx b/pages/price-tag/index.tsx index 0102c2a..0739082 100644 --- a/pages/price-tag/index.tsx +++ b/pages/price-tag/index.tsx @@ -1,112 +1,103 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; -import './price-tag.css'; const Details: React.FC<{}> = () => { return ( - + -
    - ...
    `} -css={` -:root { - --price-tag-background: rgba(0, 0, 0, 0.3); - --price-tag-height: 2rem; -} + css={` + :root { + --price-tag-background: rgba(0, 0, 0, 0.3); + --price-tag-height: 2rem; + } -.price-tag { - background: var(--price-tag-background); - color: #FFF; + .price-tag { + background: var(--price-tag-background); + color: #fff; - /* Center the price */ - align-items: center; - display: flex; - justify-content: center; + /* Center the price */ + align-items: center; + display: flex; + justify-content: center; - /* Used to position the triangle */ - position: relative; + /* Used to position the triangle */ + position: relative; - /* Size */ - height: var(--price-tag-height); + /* Size */ + height: var(--price-tag-height); - /* Spacing */ - padding: 0.25rem 0.5rem; -} + /* Spacing */ + padding: 0.25rem 0.5rem; + } -/* The triangle */ -.price-tag::before { - content: ''; + /* The triangle */ + .price-tag::before { + content: ''; - border-color: transparent var(--price-tag-background) transparent transparent; - border-style: solid; - border-width: calc(var(--price-tag-height) / 2) - calc(var(--price-tag-height) / 2) - calc(var(--price-tag-height) / 2) - 0rem; - - /* Position */ - left: 0px; - position: absolute; - top: 0px; - transform: translate(-100%, 0px); -} + border-color: transparent var(--price-tag-background) transparent transparent; + border-style: solid; + border-width: calc(var(--price-tag-height) / 2) calc(var(--price-tag-height) / 2) + calc(var(--price-tag-height) / 2) 0rem; -/* The dot */ -.price-tag::after { - content: ''; + /* Position */ + left: 0px; + position: absolute; + top: 0px; + transform: translate(-100%, 0px); + } - /* Make it like a cirle */ - background: #FFF; - border-radius: 9999rem; - - /* Position */ - left: 0; - position: absolute; - top: 50%; - transform: translate(-0.5rem, -50%); + /* The dot */ + .price-tag::after { + content: ''; - /* Size */ - height: 0.5rem; - width: 0.5rem; -} -`} + /* Make it like a cirle */ + background: #fff; + border-radius: 9999rem; + + /* Position */ + left: 0; + position: absolute; + top: 50%; + transform: translate(-0.5rem, -50%); + + /* Size */ + height: 0.5rem; + width: 0.5rem; + } + `} + > +
    -
    -
    99.99$
    -
    - -
    - +
    99.99$
    +
    + + - + ); }; diff --git a/pages/pricing-table/index.tsx b/pages/pricing-table/index.tsx index 7236bcd..07ecabe 100644 --- a/pages/pricing-table/index.tsx +++ b/pages/pricing-table/index.tsx @@ -1,15 +1,11 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Link } from 'react-router-dom'; +import Link from 'next/link'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Circle from '../../placeholders/Circle'; @@ -17,20 +13,25 @@ import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + -
    -
    - You can add a ribbon to - indicate the most popular option. -
    - + You can{' '} + + add + {' '} + + a ribbon + {' '} + to indicate the most popular option. +
    +
    @@ -51,117 +52,134 @@ html={` ...
    `} -css={` -.container { - /* Content is centered horizontally */ - align-items: center; - display: flex; - justify-content: center; -} + css={` + .container { + /* Content is centered horizontally */ + align-items: center; + display: flex; + justify-content: center; + } -.container__column { - /* Content is centered vertically */ - align-items: center; - display: flex; - flex-direction: column; - justify-content: center; + .container__column { + /* Content is centered vertically */ + align-items: center; + display: flex; + flex-direction: column; + justify-content: center; - /* Make all columns have the same width */ - flex: 1; + /* Make all columns have the same width */ + flex: 1; - /* OPTIONAL: Space between columns */ - margin: 0 8px; + /* OPTIONAL: Space between columns */ + margin: 0 8px; - /* OPTIONAL: Border */ - border: 1px solid rgba(0, 0, 0, 0.3); - border-radius: 4px; -} -`} + /* OPTIONAL: Border */ + border: 1px solid rgba(0, 0, 0, 0.3); + border-radius: 4px; + } + `} + > +
    -
    -
    -
    -
    - -
    -
    +
    +
    -
    -
    -
    -
    - -
    -
    +
    +
    -
    -
    -
    -
    - -
    -
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    - -
    - +
    + + - + ); }; diff --git a/pages/progress-bar/index.tsx b/pages/progress-bar/index.tsx index 1260623..378cc61 100644 --- a/pages/progress-bar/index.tsx +++ b/pages/progress-bar/index.tsx @@ -1,33 +1,27 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; import { Pattern } from '../../constants/Pattern'; import useInterval from '../../hooks/useInterval'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { const [progress, setProgress] = React.useState(0); useInterval(() => { - setProgress((v) => v === 100 ? 0 : v + 1); + setProgress((v) => (v === 100 ? 0 : v + 1)); }, 1 * 100); return ( - + -
    -
    -
    -
    @@ -52,59 +46,76 @@ html={`
    ...
    `} -css={` -.container { - /* Content is center horizontally */ - align-items: center; - display: flex; + css={` + .container { + /* Content is center horizontally */ + align-items: center; + display: flex; - /* + /* The property name will stick to the left, and the value will stick to the right */ - justify-content: space-between; + justify-content: space-between; - border-bottom: 1px solid rgba(0, 0, 0, 0.3); + border-bottom: 1px solid rgba(0, 0, 0, 0.3); - /* Spacing */ - margin: 0px; - padding: 8px 0px; -} -`} + /* Spacing */ + margin: 0px; + padding: 8px 0px; + } + `} + > +
    -
    -
    - -
    -
    -
    - -
    -
    -
    - -
    -
    -
    - -
    -
    -
    -
    +
    + +
    + +
    +
    + +
    +
    + +
    + +
    +
    + +
    +
    + +
    + +
    +
    + +
    +
    + +
    + +
    +
    + +
    +
    - -
    +
    +
    + +
    - + Use cases
    @@ -125,8 +136,9 @@ css={`
    + - + ); }; diff --git a/pages/questions-and-answers/index.tsx b/pages/questions-and-answers/index.tsx index bec9b14..b7c85b0 100644 --- a/pages/questions-and-answers/index.tsx +++ b/pages/questions-and-answers/index.tsx @@ -1,14 +1,10 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; @@ -23,7 +19,7 @@ const Details: React.FC<{}> = () => { const [activeItem, setActiveItem] = React.useState(-1); const Item: React.FC = ({ index, title, children }) => { - const isOpened = (index === activeItem); + const isOpened = index === activeItem; const click = () => setActiveItem(isOpened ? -1 : index); return ( <> @@ -53,16 +49,15 @@ const Details: React.FC<{}> = () => { }; return ( - + -
    -
    @@ -77,78 +72,89 @@ html={`
    `} -css={` -.container { - border-bottom: 1px solid rgba(0, 0, 0, 0.3); -} + css={` + .container { + border-bottom: 1px solid rgba(0, 0, 0, 0.3); + } -.container__heading { - display: flex; - align-items: center; - justify-content: space-between; -} -`} + .container__heading { + display: flex; + align-items: center; + justify-content: space-between; + } + `} + > +
    -
    -
    -
    +
    + +
    +
    + + +
    + } > - -
    -
    + +
    +
    + + +
    + } > -
    } - > - - -
    -
    + +
    +
    + + +
    + } > -
    } - > - - -
    -
    -
    } - > - - -
    + +
    - -
    - +
    +
    + -
    + ); }; diff --git a/pages/radial-progress-bar/index.tsx b/pages/radial-progress-bar/index.tsx index 9f735e3..1936b12 100644 --- a/pages/radial-progress-bar/index.tsx +++ b/pages/radial-progress-bar/index.tsx @@ -1,13 +1,8 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; interface RadialProgressProps { @@ -34,9 +29,7 @@ const RadialProgress: React.FC = ({ percentages }) => {
    = 50 - ? 'rect(auto, auto, auto, auto)' - : 'rect(0px, 128px, 128px, 64px)', + clip: percentages >= 50 ? 'rect(auto, auto, auto, auto)' : 'rect(0px, 128px, 128px, 64px)', height: '100%', left: 0, position: 'absolute', @@ -51,7 +44,7 @@ const RadialProgress: React.FC = ({ percentages }) => { clip: 'rect(0px, 64px, 128px, 0px)', height: '100%', position: 'absolute', - transform: `rotate(${percentages * 360 / 100}deg)`, + transform: `rotate(${(percentages * 360) / 100}deg)`, width: '100%', }} /> @@ -73,16 +66,15 @@ const RadialProgress: React.FC = ({ percentages }) => { const Details: React.FC<{}> = () => { return ( - + -
    -
    @@ -99,90 +91,91 @@ html={`
    `} -css={` -.container { - position: relative; -} + css={` + .container { + position: relative; + } -.container__percentages { - /* Center the content */ - align-items: center; - display: flex; - justify-content: center; + .container__percentages { + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; - /* Rounded border */ - border: 12px solid rgba(0, 0, 0, 0.3); - border-radius: 9999px; + /* Rounded border */ + border: 12px solid rgba(0, 0, 0, 0.3); + border-radius: 9999px; - /* Size */ - height: 128px; - width: 128px; -} + /* Size */ + height: 128px; + width: 128px; + } -.container__curve { - /* Position */ - left: 0; - position: absolute; - top: 0; + .container__curve { + /* Position */ + left: 0; + position: absolute; + top: 0; - /* Take full size */ - height: 100%; - width: 100%; + /* Take full size */ + height: 100%; + width: 100%; - /* If percentages is less than 50 */ - clip: rect(0px, 128px, 128px, 64px); + /* If percentages is less than 50 */ + clip: rect(0px, 128px, 128px, 64px); - /* If percentages is greater than or equals to 50 */ - clip: rect(auto, auto, auto, auto); -} + /* If percentages is greater than or equals to 50 */ + clip: rect(auto, auto, auto, auto); + } -.container__half { - /* Take full size */ - height: 100%; - position: absolute; - width: 100%; + .container__half { + /* Take full size */ + height: 100%; + position: absolute; + width: 100%; - /* + /* Background color of curve. The border width should be the same as the area showing the percentages */ - border: 12px solid rgb(0, 68, 158); - border-radius: 9999px; -} + border: 12px solid rgb(0, 68, 158); + border-radius: 9999px; + } -.container__half--first { - /* Position */ - clip: rect(0px, 64px, 128px, 0px); - transform: rotate(162deg); /* Number of percentages * 360 / 100 */ -} + .container__half--first { + /* Position */ + clip: rect(0px, 64px, 128px, 0px); + transform: rotate(162deg); /* Number of percentages * 360 / 100 */ + } -.container__half--second { - /* Position */ - clip: rect(0px, 64px, 128px, 0px); + .container__half--second { + /* Position */ + clip: rect(0px, 64px, 128px, 0px); - /* If percentages is less than 50 */ - transform: rotate(0deg); + /* If percentages is less than 50 */ + transform: rotate(0deg); - /* If percentages is greater than or equals to 50 */ - transform: rotate(180deg); -} -`} + /* If percentages is greater than or equals to 50 */ + transform: rotate(180deg); + } + `} + > +
    -
    -
    - +
    +
    - -
    - + +
    + +
    ); }; diff --git a/pages/radio-button-group/index.tsx b/pages/radio-button-group/index.tsx index 14b7444..5d25da7 100644 --- a/pages/radio-button-group/index.tsx +++ b/pages/radio-button-group/index.tsx @@ -1,16 +1,10 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; - -import './radio-button-group.css'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; @@ -49,16 +43,15 @@ const Details: React.FC<{}> = () => { }; return ( - + -
    -
    `} -css={` -.container { - display: flex; + css={` + .container { + display: flex; - /* Border */ - border: 1px solid rgba(0, 0, 0, 0.3); - border-radius: 4px; - height: 32px; -} + /* Border */ + border: 1px solid rgba(0, 0, 0, 0.3); + border-radius: 4px; + height: 32px; + } -.container__label { - /* Center the content */ - align-items: center; - display: inline-flex; + .container__label { + /* Center the content */ + align-items: center; + display: inline-flex; - border-right: 1px solid rgba(0, 0, 0, 0.3); - padding: 8px; + border-right: 1px solid rgba(0, 0, 0, 0.3); + padding: 8px; - /* For not selected radio */ - background-color: transparent; - color: #CCC; -} + /* For not selected radio */ + background-color: transparent; + color: #ccc; + } -.container__label:last-child { - /* Remove the right border from the last label */ - border-right-color: transparent; -} + .container__label:last-child { + /* Remove the right border from the last label */ + border-right-color: transparent; + } -.container__label--selected { - /* For selected radio */ - background-color: #00449E; - color: #FFF; -} + .container__label--selected { + /* For selected radio */ + background-color: #00449e; + color: #fff; + } -.container__input { - /* Hide it */ - display: none; -} -`} + .container__input { + /* Hide it */ + display: none; + } + `} + > +
    -
    - -
    -
    - -
    -
    - -
    -
    -
    + +
    + +
    +
    + +
    + +
    +
    + +
    + +
    +
    - -
    - +
    + + - + ); }; diff --git a/pages/radio-switch/index.tsx b/pages/radio-switch/index.tsx index 61ee331..1c50c8c 100644 --- a/pages/radio-switch/index.tsx +++ b/pages/radio-switch/index.tsx @@ -1,15 +1,10 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Heading, Spacer } from '@1milligram/design'; -import Heading from '../../components/Heading'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { @@ -17,16 +12,15 @@ const Details: React.FC<{}> = () => { const toggle = () => setFirstChecked((c) => !c); return ( - + -
    -
    @@ -41,107 +35,108 @@ html={` ...
    `} -css={` -.container { - background-color: rgba(0, 0, 0, .1); - border-radius: 9999px; - display: inline-flex; - padding: 4px; -} + css={` + .container { + background-color: rgba(0, 0, 0, 0.1); + border-radius: 9999px; + display: inline-flex; + padding: 4px; + } -.container__label { - border-radius: 9999px; - cursor: pointer; - padding: 4px 8px; -} + .container__label { + border-radius: 9999px; + cursor: pointer; + padding: 4px 8px; + } -.container__label--selected { - /* For selected radio only */ - background-color: #357edd; - color: #fff; -} + .container__label--selected { + /* For selected radio only */ + background-color: #357edd; + color: #fff; + } -.container__input { - display: none -} -`} + .container__input { + display: none; + } + `} + > +
    -
    -
    `} -css={` -.container { - /* Border */ - border: 1px dashed rgba(0, 0, 0, 0.3); + css={` + .container { + /* Border */ + border: 1px dashed rgba(0, 0, 0, 0.3); - /* Used to position the squares */ - position: relative; -} + /* Used to position the squares */ + position: relative; + } -.container__resizer { - /* Border */ - border: 1px solid rgba(0, 0, 0, 0.3); - position: absolute; + .container__resizer { + /* Border */ + border: 1px solid rgba(0, 0, 0, 0.3); + position: absolute; - /* Size */ - height: 12px; - width: 12px; -} + /* Size */ + height: 12px; + width: 12px; + } -.container__resizer--tl { - /* Resize cursor */ - cursor: nwse-resize; + .container__resizer--tl { + /* Resize cursor */ + cursor: nwse-resize; - /* Positioned at the top left corner */ - left: 0px; - top: 0px; - transform: translate(-50%, -50%); -} + /* Positioned at the top left corner */ + left: 0px; + top: 0px; + transform: translate(-50%, -50%); + } -.container__resizer--tc { - /* Resize cursor */ - cursor: ns-resize; + .container__resizer--tc { + /* Resize cursor */ + cursor: ns-resize; - /* Positioned at the middle of top side */ - left: 50%; - top: 0px; - transform: translate(-50%, -50%); -} + /* Positioned at the middle of top side */ + left: 50%; + top: 0px; + transform: translate(-50%, -50%); + } -.container__resizer--tr { - /* Resize cursor */ - cursor: nesw-resize; + .container__resizer--tr { + /* Resize cursor */ + cursor: nesw-resize; - /* Positioned at the top right corner */ - right: 0px; - top: 0px; - transform: translate(50%, -50%); -} + /* Positioned at the top right corner */ + right: 0px; + top: 0px; + transform: translate(50%, -50%); + } -.container__resizer--rc { - /* Resize cursor */ - cursor: ew-resize; + .container__resizer--rc { + /* Resize cursor */ + cursor: ew-resize; - /* Positioned at the middle of right side */ - right: 0px; - top: 50%; - transform: translate(50%, -50%); -} + /* Positioned at the middle of right side */ + right: 0px; + top: 50%; + transform: translate(50%, -50%); + } -.container__resizer--rb { - /* Resize cursor */ - cursor: nwse-resize; + .container__resizer--rb { + /* Resize cursor */ + cursor: nwse-resize; - /* Positioned at the right bottom corner */ - bottom: 0px; - right: 0px; - transform: translate(50%, 50%); -} + /* Positioned at the right bottom corner */ + bottom: 0px; + right: 0px; + transform: translate(50%, 50%); + } -.container__resizer--bc { - /* Resize cursor */ - cursor: ns-resize; + .container__resizer--bc { + /* Resize cursor */ + cursor: ns-resize; - /* Positioned at the middle of bottom side */ - bottom: 0px; - right: 50%; - transform: translate(50%, 50%); -} + /* Positioned at the middle of bottom side */ + bottom: 0px; + right: 50%; + transform: translate(50%, 50%); + } -.container__resizer--bl { - /* Resize cursor */ - cursor: nesw-resize; + .container__resizer--bl { + /* Resize cursor */ + cursor: nesw-resize; - /* Positioned at the bottom left corner */ - bottom: 0px; - left: 0px; - transform: translate(-50%, 50%); -} + /* Positioned at the bottom left corner */ + bottom: 0px; + left: 0px; + transform: translate(-50%, 50%); + } -.container__resizer--lc { - /* Resize cursor */ - cursor: ew-resize; + .container__resizer--lc { + /* Resize cursor */ + cursor: ew-resize; - /* Positioned at the middle of left side */ - left: 0px; - top: 50%; - transform: translate(-50%, -50%); -} -`} + /* Positioned at the middle of left side */ + left: 0px; + top: 50%; + transform: translate(-50%, -50%); + } + `} + > +
    -
    -
    -
    -
    -
    -
    -
    -
    -
    + /> +
    +
    +
    +
    +
    +
    +
    - -
    - +
    + + ); }; diff --git a/pages/ribbon/index.tsx b/pages/ribbon/index.tsx index 9519787..0b2c7e8 100644 --- a/pages/ribbon/index.tsx +++ b/pages/ribbon/index.tsx @@ -1,29 +1,24 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + -
    - ... @@ -41,137 +36,136 @@ html={`
    `} -css={` -.container { - /* Center the content */ - align-items: center; - display: flex; - justify-content: center; + css={` + .container { + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; - /* Background color */ - background-color: #BBB; + /* Background color */ + background-color: #bbb; - /* Size */ - height: 32px; + /* Size */ + height: 32px; - /* Use to position the corners */ - position: relative; -} + /* Use to position the corners */ + position: relative; + } -.container__side { - bottom: -8px; - position: absolute; + .container__side { + bottom: -8px; + position: absolute; - /* Displayed under the container */ - z-index: -1; + /* Displayed under the container */ + z-index: -1; - /* Background */ - border: 16px solid #CCC; - border-left-color: transparent; -} + /* Background */ + border: 16px solid #ccc; + border-left-color: transparent; + } -.container__side--left { - /* Position */ - left: -24px; -} + .container__side--left { + /* Position */ + left: -24px; + } -.container__side--right { - /* Position */ - right: -24px; -} + .container__side--right { + /* Position */ + right: -24px; + } -.container__triangle { - position: absolute; - top: 100%; + .container__triangle { + position: absolute; + top: 100%; - border: 8px solid transparent; - border-bottom-width: 0; - border-top-color: #AAA; -} + border: 8px solid transparent; + border-bottom-width: 0; + border-top-color: #aaa; + } -.container__triangle--left { - border-right-width: 0; - left: 0; -} + .container__triangle--left { + border-right-width: 0; + left: 0; + } -.container__triangle--right { - border-left-width: 0; - right: 0; -} -`} + .container__triangle--right { + border-left-width: 0; + right: 0; + } + `} + > +
    +
    - -
    -
    -
    -
    -
    + /> +
    +
    +
    - -
    - +
    + + - + ); }; diff --git a/pages/same-height-columns/index.tsx b/pages/same-height-columns/index.tsx index 1a4b264..00b3b39 100644 --- a/pages/same-height-columns/index.tsx +++ b/pages/same-height-columns/index.tsx @@ -1,29 +1,23 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + -
    -
    @@ -43,99 +37,102 @@ html={` ...
    `} -css={` -.container { - display: flex; -} + css={` + .container { + display: flex; + } -.container__column { - flex: 1; - /* Space between columns */ - margin: 0 8px; + .container__column { + flex: 1; + /* Space between columns */ + margin: 0 8px; - /* Layout each column */ - display: flex; - flex-direction: column; -} + /* Layout each column */ + display: flex; + flex-direction: column; + } -.container__content { - /* Take available height */ - flex: 1; -} -`} + .container__content { + /* Take available height */ + flex: 1; + } + `} + > +
    -
    -
    -
    - -
    - -
    -
    - -
    +
    +
    + +
    +
    -
    - -
    -
    +
    + +
    +
    +
    + +
    +
    + +
    + +
    +
    + +
    +
    +
    + +
    +
    -
    - -
    +
    -
    - -
    -
    - -
    -
    - -
    +
    +
    - -
    - +
    + + ); }; diff --git a/pages/search-box/index.tsx b/pages/search-box/index.tsx index c8678d2..b292b4d 100644 --- a/pages/search-box/index.tsx +++ b/pages/search-box/index.tsx @@ -1,28 +1,22 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Circle from '../../placeholders/Circle'; const Details: React.FC<{}> = () => { return ( - + -
    - @@ -31,83 +25,82 @@ html={` ...
    `} -css={` -.container { - display: flex; + css={` + .container { + display: flex; - /* If you want to place the icon before the text input */ - flex-direction: row-reverse; + /* If you want to place the icon before the text input */ + flex-direction: row-reverse; - /* Border */ - border: 1px solid rgba(0, 0, 0, 0.3); -} + /* Border */ + border: 1px solid rgba(0, 0, 0, 0.3); + } -.container__input { - border-color: transparent; - /* Take available width */ - flex: 1; -} -`} + .container__input { + border-color: transparent; + /* Take available width */ + flex: 1; + } + `} + > +
    -
    -
    -
    +
    + - -
    - -
    + /> +
    +
    +
    -
    + - -
    - -
    + /> +
    +
    - -
    - +
    + + ); }; diff --git a/pages/separator/index.tsx b/pages/separator/index.tsx index 6e3aa49..d178dd2 100644 --- a/pages/separator/index.tsx +++ b/pages/separator/index.tsx @@ -1,28 +1,22 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + -
    -
    @@ -33,76 +27,77 @@ html={`
    `} -css={` -.container { - /* Content is centered horizontally */ - align-items: center; - display: flex; + css={` + .container { + /* Content is centered horizontally */ + align-items: center; + display: flex; - /* Used to set the position of text */ - position: relative; -} + /* Used to set the position of text */ + position: relative; + } -.container__content { - /* We won't see the separator line */ - background: #FFF; + .container__content { + /* We won't see the separator line */ + background: #fff; - /* Displayed at the center of container */ - left: 50%; - position: absolute; - top: 50%; - transform: translate(-50%, -50%); -} + /* Displayed at the center of container */ + left: 50%; + position: absolute; + top: 50%; + transform: translate(-50%, -50%); + } -.container__separator { - border-bottom: 1px solid rgba(0, 0, 0, 0.3); - height: 1px; - width: 100%; -} -`} + .container__separator { + border-bottom: 1px solid rgba(0, 0, 0, 0.3); + height: 1px; + width: 100%; + } + `} + > +
    -
    -
    +
    +
    -
    +
    - -
    - +
    + + ); }; diff --git a/pages/sidebar/index.tsx b/pages/sidebar/index.tsx index 476a839..adc005e 100644 --- a/pages/sidebar/index.tsx +++ b/pages/sidebar/index.tsx @@ -1,29 +1,23 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { return ( - + -
    -
    Try to scroll the main content!
    - Try to scroll the main content!
    +
    `} -css={` -.container { - display: flex; -} + css={` + .container { + display: flex; + } -.container__sidebar { - width: 30%; -} + .container__sidebar { + width: 30%; + } -.container__main { - /* Take the remaining width */ - flex: 1; + .container__main { + /* Take the remaining width */ + flex: 1; - /* Make it scrollable */ - overflow: auto; -} -`} - > -
    -
    -
    -
    + /* Make it scrollable */ + overflow: auto; + } + `} + > +
    +
    +
    +
    -
    -
    -
    -
    -
    -
    +
    +
    - -
    - +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    + + ); }; diff --git a/pages/simple-grid/index.tsx b/pages/simple-grid/index.tsx index d0e687d..61d0d9e 100644 --- a/pages/simple-grid/index.tsx +++ b/pages/simple-grid/index.tsx @@ -1,20 +1,16 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + @@ -22,7 +18,7 @@ const Details: React.FC<{}> = () => {
    @@ -34,28 +30,28 @@ html={`
    `} -css={` -.row { - display: flex; + css={` + .row { + display: flex; - margin-left: -8px; - margin-right: -8px; -} + margin-left: -8px; + margin-right: -8px; + } -.row__cell { - padding-left: 8px; - padding-right: 8px; -} + .row__cell { + padding-left: 8px; + padding-right: 8px; + } -/* Cell with given width. Replace 25% with whatever you want */ -.row__cell--1/4 { - flex: 0 0 25%; -} + /* Cell with given width. Replace 25% with whatever you want */ + .row__cell--1/4 { + flex: 0 0 25%; + } -.row__cell--fill { - flex: 1; -} -`} + .row__cell--fill { + flex: 1; + } + `} >
    + - + ); }; diff --git a/pages/slider/index.tsx b/pages/slider/index.tsx index 9bb791f..97e1915 100644 --- a/pages/slider/index.tsx +++ b/pages/slider/index.tsx @@ -1,29 +1,23 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Circle from '../../placeholders/Circle'; import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + -
    - @@ -36,71 +30,74 @@ html={`
    `} -css={` -.container { - /* Content is centered horizontally */ - align-items: center; - display: flex; + css={` + .container { + /* Content is centered horizontally */ + align-items: center; + display: flex; - /* Size */ - height: 32px; -} + /* Size */ + height: 32px; + } -.container__left { - height: 2px; + .container__left { + height: 2px; - /* Colors */ - background-color: rgba(0, 0, 0, .3); -} + /* Colors */ + background-color: rgba(0, 0, 0, 0.3); + } -.container__circle { - /* Size */ - height: 32px; - width: 32px; + .container__circle { + /* Size */ + height: 32px; + width: 32px; - /* Rounded border */ - border-radius: 9999px; + /* Rounded border */ + border-radius: 9999px; - /* Colors */ - background-color: rgba(0, 0, 0, .3); -} + /* Colors */ + background-color: rgba(0, 0, 0, 0.3); + } -.container__right { - /* Take the remaining width */ - flex: 1; - height: 2px; + .container__right { + /* Take the remaining width */ + flex: 1; + height: 2px; - /* Colors */ - background-color: rgba(0, 0, 0, .3); -} -`} + /* Colors */ + background-color: rgba(0, 0, 0, 0.3); + } + `} + > +
    -
    -
    - -
    +
    + +
    + +
    +
    - -
    - +
    + +
    ); }; diff --git a/pages/spin-button/index.tsx b/pages/spin-button/index.tsx index 89c1846..4a26a1e 100644 --- a/pages/spin-button/index.tsx +++ b/pages/spin-button/index.tsx @@ -1,14 +1,10 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Triangle from '../../placeholders/Triangle'; @@ -19,16 +15,15 @@ const Details: React.FC<{}> = () => { const change = (e: React.ChangeEvent) => setValue(parseInt(e.target.value, 10)); return ( - + -
    - @@ -47,97 +42,97 @@ html={`
    `} -css={` -.container { - border: 1px solid rgba(0, 0, 0, 0.3); - border-radius: 2px; - display: flex; -} + css={` + .container { + border: 1px solid rgba(0, 0, 0, 0.3); + border-radius: 2px; + display: flex; + } -.container__input { - border-color: transparent; - margin-right: 4px; - padding: 4px; - width: 100px; -} + .container__input { + border-color: transparent; + margin-right: 4px; + padding: 4px; + width: 100px; + } -.container__buttons { - /* Content is centered vertically */ - display: flex; - flex-direction: column; - justify-content: center; -} + .container__buttons { + /* Content is centered vertically */ + display: flex; + flex-direction: column; + justify-content: center; + } -.container__button { - border-color: transparent; - /* Make buttons have the same height */ - flex: 1, -} -`} + .container__button { + border-color: transparent; + /* Make buttons have the same height */ + flex: 1; + } + `} + > +
    +
    - -
    - - -
    + + +
    - -
    +
    + + - + ); }; diff --git a/pages/split-navigation/index.tsx b/pages/split-navigation/index.tsx index ad3128f..554b88c 100644 --- a/pages/split-navigation/index.tsx +++ b/pages/split-navigation/index.tsx @@ -1,29 +1,24 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + -
    -
  • @@ -36,55 +31,63 @@ html={`
  • `} -css={` -.container { - /* Content is centered horizontally */ - align-items: center; - display: flex; + css={` + .container { + /* Content is centered horizontally */ + align-items: center; + display: flex; - /* Reset styles */ - list-style-type: none; - margin: 0; -} + /* Reset styles */ + list-style-type: none; + margin: 0; + } -.container__item--right { - /* Sticks to the right */ - margin-left: auto; -} -`} + .container__item--right { + /* Sticks to the right */ + margin-left: auto; + } + `} + > +
    -
    -
      -
    • -
    • -
    • -
    • -
    -
    - -
    +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • + +
    + + -
    + ); }; diff --git a/pages/split-screen/index.tsx b/pages/split-screen/index.tsx index a387a6e..d89914b 100644 --- a/pages/split-screen/index.tsx +++ b/pages/split-screen/index.tsx @@ -1,13 +1,8 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Circle from '../../placeholders/Circle'; @@ -15,16 +10,15 @@ import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + -
    -
    @@ -37,48 +31,55 @@ html={`
    `} -css={` -.container { - display: flex; -} + css={` + .container { + display: flex; + } -.container__half { - flex: 1; -} -`} - > -
    -
    -
    -
    + .container__half { + flex: 1; + } + `} + > +
    +
    +
    +
    -
    -
    -
    -
    - -
    +
    +
    - -
    - +
    +
    +
    + +
    +
    + +
    + +
    +
    +
    + + ); }; diff --git a/pages/stacked-cards/index.tsx b/pages/stacked-cards/index.tsx index 4d31544..791bae8 100644 --- a/pages/stacked-cards/index.tsx +++ b/pages/stacked-cards/index.tsx @@ -1,19 +1,15 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { return ( - + @@ -21,7 +17,7 @@ const Details: React.FC<{}> = () => {
    @@ -30,33 +26,33 @@ html={` ...
    `} -css={` -.container { - /* Used to position the stacked cards */ - position: relative; -} + css={` + .container { + /* Used to position the stacked cards */ + position: relative; + } -.container__card { - /* Absolute position */ - left: 0px; - position: absolute; - top: 0px; + .container__card { + /* Absolute position */ + left: 0px; + position: absolute; + top: 0px; - /* Take full size */ - height: 100%; - width: 100%; + /* Take full size */ + height: 100%; + width: 100%; - /* Displayed under the container */ - z-index: -1; + /* Displayed under the container */ + z-index: -1; - /* Background and border colors */ - background-color: rgb(255, 255, 255); - border: 1px solid rgba(0, 0, 0, 0.3); + /* Background and border colors */ + background-color: rgb(255, 255, 255); + border: 1px solid rgba(0, 0, 0, 0.3); - /* Rotate it. Change the number of degrees for the following cards */ - transform: rotate(5deg); -} -`} + /* Rotate it. Change the number of degrees for the following cards */ + transform: rotate(5deg); + } + `} >
    - { - Array(5).fill(0).map((_, index) => { + {Array(5) + .fill(0) + .map((_, index) => { return (
    ); - }) - } + })}
    + - + ); }; diff --git a/pages/stamp-border/index.tsx b/pages/stamp-border/index.tsx index 0cb6d87..399ee9d 100644 --- a/pages/stamp-border/index.tsx +++ b/pages/stamp-border/index.tsx @@ -1,27 +1,21 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { return ( - + -
    -
    @@ -30,58 +24,57 @@ html={`
    `} -css={` -.container { - /* Background */ - background-color: #ccc; - background-image: radial-gradient(#fff 50%, transparent 50%); - background-position: -5px -5px; - background-repeat: repeat; - background-size: 10px 10px; + css={` + .container { + /* Background */ + background-color: #ccc; + background-image: radial-gradient(#fff 50%, transparent 50%); + background-position: -5px -5px; + background-repeat: repeat; + background-size: 10px 10px; - /* Spacing */ - padding: 5px; -} + /* Spacing */ + padding: 5px; + } -.container__inner { - /* Background */ - background-color: #ccc; -} -`} + .container__inner { + /* Background */ + background-color: #ccc; + } + `} + > +
    -
    -
    + />
    - -
    - +
    + +
    ); }; diff --git a/pages/statistic/index.tsx b/pages/statistic/index.tsx index cf0887e..32c9666 100644 --- a/pages/statistic/index.tsx +++ b/pages/statistic/index.tsx @@ -1,28 +1,22 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; +import { Pattern } from '../../constants/Pattern'; import { random } from '../../utils/random'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { return ( - + -
    -
    @@ -35,58 +29,53 @@ html={`
    `} -css={` -.container { - /* Center the content */ - align-items: center; - display: inline-flex; - flex-direction: column; -} + css={` + .container { + /* Center the content */ + align-items: center; + display: inline-flex; + flex-direction: column; + } -.container__value { - /* Big font size */ - font-size: 4rem; - font-weight: 500; -} + .container__value { + /* Big font size */ + font-size: 4rem; + font-weight: 500; + } -.container__label { - /* Smaller font size */ - font-size: 1rem; - font-weight: 700; + .container__label { + /* Smaller font size */ + font-size: 1rem; + font-weight: 700; - /* Uppercase the label */ - text-transform: uppercase; -} -`} + /* Uppercase the label */ + text-transform: uppercase; + } + `} + > +
    -
    -
    - {random(1000, 9999).toLocaleString()} -
    -
    - stars -
    -
    +
    {random(1000, 9999).toLocaleString()}
    +
    stars
    - -
    -
    +
    + +
    ); }; diff --git a/pages/status-light/index.tsx b/pages/status-light/index.tsx index 26bc963..297485e 100644 --- a/pages/status-light/index.tsx +++ b/pages/status-light/index.tsx @@ -1,29 +1,23 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import Heading from '../../components/Heading'; +import { Heading, Spacer } from '@1milligram/design'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + -
    -
    @@ -34,71 +28,71 @@ html={`
    `} -css={` -.container { - /* Center the content */ - align-items: center; - display: flex; -} + css={` + .container { + /* Center the content */ + align-items: center; + display: flex; + } -.container__status { - /* Background color */ - background-color: rgb(66, 153, 225); + .container__status { + /* Background color */ + background-color: rgb(66, 153, 225); - /* Rounded border */ - border-radius: 9999px; + /* Rounded border */ + border-radius: 9999px; - /* Size */ - height: 8px; - width: 8px; + /* Size */ + height: 8px; + width: 8px; - /* Spacing */ - margin-right: 8px; -} + /* Spacing */ + margin-right: 8px; + } -.container__content { - /* Take available width */ - flex: 1; -} -`} + .container__content { + /* Take available width */ + flex: 1; + } + `} + > +
    -
    + /> -
    - -
    +
    +
    - -
    +
    + +
    - + Use cases
    - In review
    @@ -147,7 +140,6 @@ css={` width: '8px', }} /> - Draft
    @@ -166,14 +158,13 @@ css={` width: '8px', }} /> - Published
    - + ); }; diff --git a/pages/stepper-input/index.tsx b/pages/stepper-input/index.tsx index 45b5df7..f04cc3d 100644 --- a/pages/stepper-input/index.tsx +++ b/pages/stepper-input/index.tsx @@ -1,14 +1,10 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { @@ -22,16 +18,15 @@ const Details: React.FC<{}> = () => { }; return ( - + -
    - @@ -45,112 +40,112 @@ html={`
    `} -css={` -.stepper { - display: flex; + css={` + .stepper { + display: flex; - /* Border */ - border: 1px solid rgba(0, 0, 0, .3); + /* Border */ + border: 1px solid rgba(0, 0, 0, 0.3); - /* Size */ - height: 32px; - width: 128px; -} + /* Size */ + height: 32px; + width: 128px; + } -.stepper__button { - /* Center the content */ - align-items: center; - display: flex; - justify-content: center; + .stepper__button { + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; - /* Size */ - width: 32px; -} + /* Size */ + width: 32px; + } -.stepper__content { - flex: 1; -} + .stepper__content { + flex: 1; + } -.stepper__input { - /* Take full size of its container */ - height: 100%; - width: 100%; -} -`} + .stepper__input { + /* Take full size of its container */ + height: 100%; + width: 100%; + } + `} + > +
    +
    - -
    - -
    - + value={value} + onChange={change} + />
    +
    - -
    +
    + + - + ); }; diff --git a/pages/sticky-footer/index.tsx b/pages/sticky-footer/index.tsx index 57cc2f5..a1e2814 100644 --- a/pages/sticky-footer/index.tsx +++ b/pages/sticky-footer/index.tsx @@ -1,32 +1,26 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + -
    -
    - The footer always sticks to the bottom if the main content is short. -
    - + The footer always sticks to the bottom if the main content is short. +
    +
    ... @@ -39,55 +33,58 @@ html={`
    `} -css={` -.container { - display: flex; - flex-direction: column; - height: 100%; -} + css={` + .container { + display: flex; + flex-direction: column; + height: 100%; + } -.container__header, -.container__footer { - flex-shrink: 0; -} + .container__header, + .container__footer { + flex-shrink: 0; + } -.container__main { - flex-grow: 1; -} -`} + .container__main { + flex-grow: 1; + } + `} + > +
    -
    -
    -
    -
    - -
    -
    -
    +
    +
    - -
    - +
    + +
    +
    +
    + +
    +
    +
    + + ); }; diff --git a/pages/sticky-header/index.tsx b/pages/sticky-header/index.tsx index 6697e6a..14d5548 100644 --- a/pages/sticky-header/index.tsx +++ b/pages/sticky-header/index.tsx @@ -1,33 +1,28 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + -
    -
    - Try to scroll the main content to see the header sticks to the top of page. -
    - + Try to scroll the main content to see the header sticks to the top of page. +
    +
    ... @@ -37,41 +32,48 @@ html={`
    `} -css={` -.header { - /* Stick to the top */ - position: sticky; - top: 0; -} -`} - > -
    -
    -
    -
    -
    -
    -
    -
    + css={` + .header { + /* Stick to the top */ + position: sticky; + top: 0; + } + `} + > +
    +
    +
    +
    - -
    +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    + + + - + ); }; diff --git a/pages/sticky-sections/index.tsx b/pages/sticky-sections/index.tsx index b424f54..faac991 100644 --- a/pages/sticky-sections/index.tsx +++ b/pages/sticky-sections/index.tsx @@ -1,31 +1,26 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { return ( - + -
    -
    - Try to scroll the main content to see each section sticks to the top of page. -
    - + Try to scroll the main content to see each section sticks to the top of page. +
    +
    ... @@ -35,62 +30,61 @@ html={` ...
    `} -css={` -.container { - height: 100%; - overflow: scroll; -} + css={` + .container { + height: 100%; + overflow: scroll; + } -.container__section { - /* Take full size */ - height: 100%; - width: 100%; + .container__section { + /* Take full size */ + height: 100%; + width: 100%; - /* Stick to the top */ - position: sticky; - top: 0; -} -`} + /* Stick to the top */ + position: sticky; + top: 0; + } + `} + > +
    -
    -
    -
    -
    -
    - -
    - + /> +
    +
    +
    +
    + - + ); }; diff --git a/pages/sticky-table-column/index.tsx b/pages/sticky-table-column/index.tsx index 60d708d..c4d24a1 100644 --- a/pages/sticky-table-column/index.tsx +++ b/pages/sticky-table-column/index.tsx @@ -1,15 +1,11 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - // tslint:disable:prefer-object-spread import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; @@ -17,19 +13,18 @@ import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { const numberOfColumns = 10; return ( - + -
    -
    - Try to scroll the main content of table horizontally to see the first column sticks to the left. -
    - + Try to scroll the main content of table horizontally to see the first column sticks to the left. +
    + @@ -44,120 +39,117 @@ html={` `} -css={` -.header { - /* Background color */ - background-color: #ddd; + css={` + .header { + /* Background color */ + background-color: #ddd; - /* Stick to the left */ - left: 0; - position: sticky; + /* Stick to the left */ + left: 0; + position: sticky; - /* Displayed on top of other rows when scrolling */ - z-index: 9999; -} -`} + /* Displayed on top of other rows when scrolling */ + z-index: 9999; + } + `} + > +
    -
    - - - - { - Array(numberOfColumns).fill(0).map((_, index) => { - return ( - - ); - }) - } - - - - { - Array(10).fill(0).map((_, row) => { + + + {Array(numberOfColumns) + .fill(0) + .map((_, index) => { return ( - - { - Array(numberOfColumns).fill(0).map((__, col) => { - return ( - - ); - }) + ); - }) - } - -
    -
    - { - index === 0 - ? - : - } -
    -
    - { - col === 0 - ? - : - } - + > +
    + {index === 0 ? : } +
    +
    -
    + })} + + + + {Array(10) + .fill(0) + .map((_, row) => { + return ( + + {Array(numberOfColumns) + .fill(0) + .map((__, col) => { + return ( + + {col === 0 ? ( + + ) : ( + + )} + + ); + })} + + ); + })} + +
    - -
    - +
    + + -
    + ); }; diff --git a/pages/sticky-table-headers/index.tsx b/pages/sticky-table-headers/index.tsx index e4d6164..15d35b8 100644 --- a/pages/sticky-table-headers/index.tsx +++ b/pages/sticky-table-headers/index.tsx @@ -1,33 +1,28 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + -
    -
    - Try to scroll the main content of table to see the header sticks to the top. -
    - + Try to scroll the main content of table to see the header sticks to the top. +
    + @@ -42,97 +37,93 @@ html={` `} -css={` -.header { - /* Background color */ - background-color: #ddd; + css={` + .header { + /* Background color */ + background-color: #ddd; - /* Stick to the top */ - position: sticky; - top: 0; + /* Stick to the top */ + position: sticky; + top: 0; - /* Displayed on top of other rows when scrolling */ - z-index: 9999; -} -`} + /* Displayed on top of other rows when scrolling */ + z-index: 9999; + } + `} + > +
    -
    - - - - { - Array(3).fill(0).map((_, index) => { - return ( - - ); - }) - } - - - - { - Array(10).fill(0).map((_, row) => { + + + {Array(3) + .fill(0) + .map((_, index) => { return ( - - { - Array(3).fill(0).map((__, col) => { - return ( - - ); - }) - } - + ); - }) - } - -
    - -
    - -
    + +
    -
    + })} + + + + {Array(10) + .fill(0) + .map((_, row) => { + return ( + + {Array(3) + .fill(0) + .map((__, col) => { + return ( + + + + ); + })} + + ); + })} + +
    - -
    +
    + + - - + + ); }; diff --git a/pages/switch/index.tsx b/pages/switch/index.tsx index 3fc6fb8..39504ef 100644 --- a/pages/switch/index.tsx +++ b/pages/switch/index.tsx @@ -1,14 +1,10 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { @@ -16,20 +12,19 @@ const Details: React.FC<{}> = () => { const toggle = () => setChecked((c) => !c); return ( - + -
    -
    - The checkbox is placed inside a label. So when clicking on the label, - the checkbox will be checked even though it's hidden. -
    - + The checkbox is placed inside a label. So when clicking on the label, the checkbox will be checked even + though it's hidden. +
    + @@ -37,90 +32,90 @@ html={`
    `} -css={` -.label { - display: flex; + css={` + .label { + display: flex; - /* Rounded border */ - border-radius: 9999px; + /* Rounded border */ + border-radius: 9999px; - /* Size */ - height: 32px; - width: 64px; + /* Size */ + height: 32px; + width: 64px; - /* OFF status */ - background-color: rgba(0, 0, 0, .1); - border: 1px solid rgba(0, 0, 0, .3); + /* OFF status */ + background-color: rgba(0, 0, 0, 0.1); + border: 1px solid rgba(0, 0, 0, 0.3); - /* ON status */ - background-color: #357edd; - border: 1px solid #357edd; - /* Push the circle to the right */ - justify-content: flex-end; -} + /* ON status */ + background-color: #357edd; + border: 1px solid #357edd; + /* Push the circle to the right */ + justify-content: flex-end; + } -.label__input { - /* Hide the input */ - display: none; -} + .label__input { + /* Hide the input */ + display: none; + } -.label__circle { - /* Rounded border */ - border-radius: 9999px; + .label__circle { + /* Rounded border */ + border-radius: 9999px; - /* Size */ - width: 32px; + /* Size */ + width: 32px; - background-color: #FFF; + background-color: #fff; - /* OFF status */ - border: 1px solid rgba(0, 0, 0, .3); -} -`} + /* OFF status */ + border: 1px solid rgba(0, 0, 0, 0.3); + } + `} + > +
    -
    - +
    + + - + ); }; diff --git a/pages/tab/index.tsx b/pages/tab/index.tsx index 326ddf0..5a222e9 100644 --- a/pages/tab/index.tsx +++ b/pages/tab/index.tsx @@ -1,13 +1,8 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; @@ -39,16 +34,15 @@ const Details: React.FC<{}> = () => { }; return ( - + -
    -
    @@ -61,68 +55,67 @@ html={`
    `} -css={` -.tabs { - /* Center the content */ - align-items: center; - display: flex; - justify-content: center; -} + css={` + .tabs { + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; + } -.tabs__tab--active { - /* Border */ - border: 1px solid rgba(0, 0, 0, 0.3); - /* Hide the bottom border */ - border-bottom-color: transparent; + .tabs__tab--active { + /* Border */ + border: 1px solid rgba(0, 0, 0, 0.3); + /* Hide the bottom border */ + border-bottom-color: transparent; - /* Border radius */ - border-top-left-radius: 2px; - border-top-right-radius: 2px; -} + /* Border radius */ + border-top-left-radius: 2px; + border-top-right-radius: 2px; + } -.tabs__tab--inactive { - /* Has only the bottom border */ - border-bottom: 1px solid rgba(0, 0, 0, 0.3); -} -`} + .tabs__tab--inactive { + /* Has only the bottom border */ + border-bottom: 1px solid rgba(0, 0, 0, 0.3); + } + `} + > +
    -
    - -
    - -
    -
    - -
    - -
    -
    - -
    - -
    -
    -
    + +
    + +
    +
    + +
    + +
    +
    + +
    + +
    +
    - -
    -
    +
    +
    +
    ); }; diff --git a/pages/teardrop/index.tsx b/pages/teardrop/index.tsx index 3d72f1c..1c091ed 100644 --- a/pages/teardrop/index.tsx +++ b/pages/teardrop/index.tsx @@ -1,28 +1,25 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Circle from '../../placeholders/Circle'; const Details: React.FC<{}> = () => { return ( - + - + -
    -
    @@ -30,60 +27,59 @@ html={`
    `} -css={` -.container { - /* Center the content */ - align-items: center; - display: flex; - justify-content: center; + css={` + .container { + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; - /* Border */ - border: 2px solid rgba(0, 0, 0, 0.3); - border-radius: 0px 50% 50% 50%; + /* Border */ + border: 2px solid rgba(0, 0, 0, 0.3); + border-radius: 0px 50% 50% 50%; - /* Angle at the top */ - transform: rotate(45deg); + /* Angle at the top */ + transform: rotate(45deg); - /* Size */ - height: 64px; - width: 64px; -} + /* Size */ + height: 64px; + width: 64px; + } -.container__content { - transform: rotate(-45deg); -} -`} + .container__content { + transform: rotate(-45deg); + } + `} + > +
    -
    -
    - -
    +
    +
    - -
    - +
    + +
    ); }; diff --git a/pages/three-dimensions-card/index.tsx b/pages/three-dimensions-card/index.tsx index 6f27e68..acf75b6 100644 --- a/pages/three-dimensions-card/index.tsx +++ b/pages/three-dimensions-card/index.tsx @@ -1,20 +1,16 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import './styles.css'; const Details: React.FC<{}> = () => { return ( - + @@ -22,54 +18,54 @@ const Details: React.FC<{}> = () => { ...
    `} -css={` -:root { - --three-dimensions-card-left-side-width: 1rem; -} + css={` + :root { + --three-dimensions-card-left-side-width: 1rem; + } -.three-dimensions-card { - position: relative; -} + .three-dimensions-card { + position: relative; + } -/* The left side */ -.three-dimensions-card::before { - background: rgba(0, 0, 0, 0.3); - content: ''; - - /* Position */ - top: var(--three-dimensions-card-left-side-width); - left: 0px; - position: absolute; - transform: translate(-100%, 0) skewY(-45deg); - transform-origin: left top; + /* The left side */ + .three-dimensions-card::before { + background: rgba(0, 0, 0, 0.3); + content: ''; - /* Size */ - height: 100%; - width: var(--three-dimensions-card-left-side-width); -} + /* Position */ + top: var(--three-dimensions-card-left-side-width); + left: 0px; + position: absolute; + transform: translate(-100%, 0) skewY(-45deg); + transform-origin: left top; -/* The bottom side */ -.three-dimensions-card::after { - background: rgba(0, 0, 0, 0.3); - content: ''; - - /* Position */ - bottom: 0px; - left: 0px; - position: absolute; - transform: translate(0, 100%) skewX(-45deg); - transform-origin: left top; + /* Size */ + height: 100%; + width: var(--three-dimensions-card-left-side-width); + } - /* Size */ - height: var(--three-dimensions-card-left-side-width); - width: 100%; -} -`} + /* The bottom side */ + .three-dimensions-card::after { + background: rgba(0, 0, 0, 0.3); + content: ''; + + /* Position */ + bottom: 0px; + left: 0px; + position: absolute; + transform: translate(0, 100%) skewX(-45deg); + transform-origin: left top; + + /* Size */ + height: var(--three-dimensions-card-left-side-width); + width: 100%; + } + `} >
    + - + ); }; diff --git a/pages/timeline/index.tsx b/pages/timeline/index.tsx index cfe1ce7..6ad9560 100644 --- a/pages/timeline/index.tsx +++ b/pages/timeline/index.tsx @@ -1,14 +1,10 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; +import { Spacer } from '@1milligram/design'; +import { Pattern } from '../../constants/Pattern'; import { RelatedPatterns } from '../../components/RelatedPatterns'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Circle from '../../placeholders/Circle'; @@ -16,7 +12,7 @@ import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + @@ -24,7 +20,7 @@ const Details: React.FC<{}> = () => {
    @@ -55,62 +51,62 @@ html={`
    `} -css={` -.container { - /* Used to position the left vertical line */ - position: relative; -} + css={` + .container { + /* Used to position the left vertical line */ + position: relative; + } -.container__line { - /* Border */ - border-right: 2px solid #aaa; + .container__line { + /* Border */ + border-right: 2px solid #aaa; - /* Positioned at the left */ - left: 16px; - position: absolute; - top: 0px; + /* Positioned at the left */ + left: 16px; + position: absolute; + top: 0px; - /* Take full height */ - height: 100%; -} + /* Take full height */ + height: 100%; + } -.container__items { - /* Reset styles */ - list-style-type: none; - margin: 0px; - padding: 0px; -} + .container__items { + /* Reset styles */ + list-style-type: none; + margin: 0px; + padding: 0px; + } -.container__item { - margin-bottom: 8px; -} + .container__item { + margin-bottom: 8px; + } -.container__top { - /* Center the content horizontally */ - align-items: center; - display: flex; -} + .container__top { + /* Center the content horizontally */ + align-items: center; + display: flex; + } -.container__circle { - /* Rounded border */ - background-color: rgb(170, 170, 170); - border-radius: 9999px; + .container__circle { + /* Rounded border */ + background-color: rgb(170, 170, 170); + border-radius: 9999px; - /* Size */ - height: 32px; - width: 32px; -} + /* Size */ + height: 32px; + width: 32px; + } -.container__title { - /* Take available width */ - flex: 1; -} + .container__title { + /* Take available width */ + flex: 1; + } -.container__desc { - /* Make it align with the title */ - margin-left: 48px; -} -`} + .container__desc { + /* Make it align with the title */ + margin-left: 48px; + } + `} >
  • - +
    -
    +
    + +
    @@ -157,9 +155,11 @@ css={`
  • - +
    -
    +
    + +
    @@ -168,9 +168,11 @@ css={`
  • - +
    -
    +
    + +
    @@ -182,8 +184,9 @@ css={`
    + - + ); }; diff --git a/pages/toggle-password-visibility/index.tsx b/pages/toggle-password-visibility/index.tsx index fc9a3c7..e9c4d0b 100644 --- a/pages/toggle-password-visibility/index.tsx +++ b/pages/toggle-password-visibility/index.tsx @@ -1,13 +1,8 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { @@ -15,16 +10,15 @@ const Details: React.FC<{}> = () => { const toggle = () => setVisible((v) => !v); return ( - + -
    - @@ -35,80 +29,79 @@ html={`
    `} -css={` -.container { - display: flex; + css={` + .container { + display: flex; - /* Border */ - border: 1px solid rgba(0, 0, 0, 0.3); -} + /* Border */ + border: 1px solid rgba(0, 0, 0, 0.3); + } -.container__input { - border-color: transparent; - /* Take available width */ - flex: 1; -} -`} + .container__input { + border-color: transparent; + /* Take available width */ + flex: 1; + } + `} + > +
    -
    -
    -
    +
    + + -
    + } + /> + +
    - -
    - +
    + +
    ); }; diff --git a/pages/tooltip/index.tsx b/pages/tooltip/index.tsx index 7aa3030..ffd3726 100644 --- a/pages/tooltip/index.tsx +++ b/pages/tooltip/index.tsx @@ -1,35 +1,28 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; - -import './tooltip.css'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + -
    -
    - Move the mouser over the main element to see the tooltip. -
    - + Move the mouser over the main element to see the tooltip. +
    +
    @@ -43,101 +36,100 @@ html={` ...
    `} -css={` -.container { - /* Used to position the arrow */ - position: relative; -} + css={` + .container { + /* Used to position the arrow */ + position: relative; + } -/* Show the arrow and content and restore pointer events when hovering the trigger element */ -.container:hover .container__arrow, -.container:hover .container__content { - opacity: 1; - pointer-events: initial; -} + /* Show the arrow and content and restore pointer events when hovering the trigger element */ + .container:hover .container__arrow, + .container:hover .container__content { + opacity: 1; + pointer-events: initial; + } -.container__arrow { - /* Invisible by default */ - opacity: 0; + .container__arrow { + /* Invisible by default */ + opacity: 0; - /* To prevent accidental interactions with other elements */ - pointer-events: none; + /* To prevent accidental interactions with other elements */ + pointer-events: none; - /* Border */ - border: 8px solid transparent; - border-top-color: #00439e; + /* Border */ + border: 8px solid transparent; + border-top-color: #00439e; - /* Position */ - bottom: 100%; - left: 50%; - position: absolute; - transform: translate(-50%, 8px); + /* Position */ + bottom: 100%; + left: 50%; + position: absolute; + transform: translate(-50%, 8px); - /* Zero size */ - height: 0; - width: 0; + /* Zero size */ + height: 0; + width: 0; - /* Displayed on top of other element */ - z-index: 10; -} + /* Displayed on top of other element */ + z-index: 10; + } -.container__content { - /* Invisible by default */ - opacity: 0; + .container__content { + /* Invisible by default */ + opacity: 0; - /* To prevent accidental interactions with other elements */ - pointer-events: none; + /* To prevent accidental interactions with other elements */ + pointer-events: none; - /* Background color, must be the same as the border color of arrow */ - background-color: #00439e; - border-radius: 2px; + /* Background color, must be the same as the border color of arrow */ + background-color: #00439e; + border-radius: 2px; - /* Position */ - bottom: 100%; - left: 50%; - position: absolute; - transform: translate(-50%, -8px); + /* Position */ + bottom: 100%; + left: 50%; + position: absolute; + transform: translate(-50%, -8px); - /* Displayed on top of other element */ - z-index: 10; -} -`} + /* Displayed on top of other element */ + z-index: 10; + } + `} + > +
    -
    - -
    -
    - +
    +
    +
    - -
    - +
    + + - + ); }; diff --git a/pages/tree-diagram/index.tsx b/pages/tree-diagram/index.tsx index f7659c3..b4a549e 100644 --- a/pages/tree-diagram/index.tsx +++ b/pages/tree-diagram/index.tsx @@ -1,21 +1,16 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Square from '../../placeholders/Square'; -import './tree-diagram.css'; const Details: React.FC<{}> = () => { return ( - + @@ -23,7 +18,7 @@ const Details: React.FC<{}> = () => {
    • @@ -53,80 +48,80 @@ html={`
    `} -css={` -.tree-diagram ul { - display: flex; - position: relative; + css={` + .tree-diagram ul { + display: flex; + position: relative; - /* Reset */ - list-style-type: none; - margin: 0; - padding: 1rem 0.5rem 0rem 0.5rem; -} + /* Reset */ + list-style-type: none; + margin: 0; + padding: 1rem 0.5rem 0rem 0.5rem; + } -.tree-diagram ul ul::before { - border-right: 1px solid rgba(0, 0, 0, .3); - content: ''; - - /* Position */ - position: absolute; - top: 0; - right: 50%; + .tree-diagram ul ul::before { + border-right: 1px solid rgba(0, 0, 0, 0.3); + content: ''; - /* Size */ - height: 1rem; - width: 50%; -} + /* Position */ + position: absolute; + top: 0; + right: 50%; -.tree-diagram li { - padding: 1rem 0.5rem 0rem 0.5rem; - position: relative; + /* Size */ + height: 1rem; + width: 50%; + } - /* Center the content */ - align-items: center; - display: flex; - flex-direction: column; -} + .tree-diagram li { + padding: 1rem 0.5rem 0rem 0.5rem; + position: relative; -.tree-diagram li::before { - border-right: 1px solid rgba(0, 0, 0, .3); - border-top: 1px solid rgba(0, 0, 0, .3); - content: ''; + /* Center the content */ + align-items: center; + display: flex; + flex-direction: column; + } - /* Position */ - position: absolute; - top: 0; - right: 50%; + .tree-diagram li::before { + border-right: 1px solid rgba(0, 0, 0, 0.3); + border-top: 1px solid rgba(0, 0, 0, 0.3); + content: ''; - /* Size */ - height: 1rem; - width: 50%; -} + /* Position */ + position: absolute; + top: 0; + right: 50%; -.tree-diagram li::after { - border-top: 1px solid rgba(0, 0, 0, .3); - content: ''; + /* Size */ + height: 1rem; + width: 50%; + } - /* Position */ - position: absolute; - top: 0; - right: 0; + .tree-diagram li::after { + border-top: 1px solid rgba(0, 0, 0, 0.3); + content: ''; - /* Size */ - width: 50%; -} + /* Position */ + position: absolute; + top: 0; + right: 0; -.tree-diagram li:first-child::before, -.tree-diagram li:last-child::after { - /* Remove the top of border from the first and last items */ - border-top: none; -} + /* Size */ + width: 50%; + } -/* Add a root item if you want */ -li.tree-diagram__root::before { - border-right: none; -} -`} + .tree-diagram li:first-child::before, + .tree-diagram li:last-child::after { + /* Remove the top of border from the first and last items */ + border-top: none; + } + + /* Add a root item if you want */ + li.tree-diagram__root::before { + border-right: none; + } + `} >
    • - +
      • - +
          -
        • +
        • + +
      • - +
        • - +
            -
          • -
          • -
          • +
          • + +
          • +
          • + +
          • +
          • + +
        • -
        • - + +
        • +
        • +
            -
          • -
          • +
          • + +
          • +
          • + +
      • -
      • +
      • + +
      -
    • +
  • + - + ); }; diff --git a/pages/triangle-buttons/index.tsx b/pages/triangle-buttons/index.tsx index c73b196..a405e13 100644 --- a/pages/triangle-buttons/index.tsx +++ b/pages/triangle-buttons/index.tsx @@ -1,28 +1,23 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { return ( - + -
    - `} -css={` -.container { - /* Center the content */ - align-items: center; - display: flex; - justify-content: center; + css={` + .container { + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; - /* Spacing */ - padding: 8px; -} + /* Spacing */ + padding: 8px; + } -.container__triangle { - border-style: solid; + .container__triangle { + border-style: solid; - /* Size */ - height: 0px; - width: 0px; -} + /* Size */ + height: 0px; + width: 0px; + } -.container__triangle--up { - border-color: transparent transparent rgba(0, 0, 0, 0.3); - border-width: 0px 8px 8px; -} + .container__triangle--up { + border-color: transparent transparent rgba(0, 0, 0, 0.3); + border-width: 0px 8px 8px; + } -.container__triangle--right { - border-color: transparent transparent transparent rgba(0, 0, 0, 0.3); - border-width: 8px 0px 8px 8px; -} + .container__triangle--right { + border-color: transparent transparent transparent rgba(0, 0, 0, 0.3); + border-width: 8px 0px 8px 8px; + } -.container__triangle--down { - border-color: rgba(0, 0, 0, 0.3) transparent transparent; - border-width: 8px 8px 0px; -} + .container__triangle--down { + border-color: rgba(0, 0, 0, 0.3) transparent transparent; + border-width: 8px 8px 0px; + } -.container__triangle--left { - border-color: transparent rgba(0, 0, 0, 0.3) transparent transparent; - border-width: 8px 8px 8px 0px; -} -`} + .container__triangle--left { + border-color: transparent rgba(0, 0, 0, 0.3) transparent transparent; + border-width: 8px 8px 8px 0px; + } + `} + > +
    -
    - -
    -
    +
    Up
    + +
    +
    +
    +
    -
    Right
    -
    - -
    -
    + +
    +
    + -
    -
    +
    Down
    + +
    +
    + -
    + /> +
    Left
    +
    - -
    - +
    +
    + - + ); }; diff --git a/pages/upload-button/index.tsx b/pages/upload-button/index.tsx index c8ba22c..d00b902 100644 --- a/pages/upload-button/index.tsx +++ b/pages/upload-button/index.tsx @@ -1,31 +1,23 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; const Details: React.FC<{}> = () => { return ( - + -
    -
    - You can click the button to choose a file. -
    - You can click the button to choose a file.
    + @@ -37,97 +29,96 @@ html={` ...
    `} -css={` -.container { - /* Used to position the input */ - position: relative; + css={` + .container { + /* Used to position the input */ + position: relative; - /* Center the content */ - align-items: center; - display: flex; + /* Center the content */ + align-items: center; + display: flex; - /* Border */ - border: 1px solid rgba(0, 0, 0, 0.3); -} + /* Border */ + border: 1px solid rgba(0, 0, 0, 0.3); + } -.container__input { - /* Take the full size */ - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; + .container__input { + /* Take the full size */ + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; - /* Make it transparent */ - opacity: 0; -} + /* Make it transparent */ + opacity: 0; + } -.container__icon { - margin-right: 8px -} -`} + .container__icon { + margin-right: 8px; + } + `} + > +
    -
    -
    -
    +
    + - +
    + -
    - - + - -
    - + /> +
    +
    - -
    - +
    + + ); }; diff --git a/pages/validation-icon/index.tsx b/pages/validation-icon/index.tsx index af692e1..2452e05 100644 --- a/pages/validation-icon/index.tsx +++ b/pages/validation-icon/index.tsx @@ -1,27 +1,21 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { return ( - + -
    - @@ -33,132 +27,131 @@ html={`
    `} -css={` -.container { - /* Used to position the validation icon */ - position: relative; -} + css={` + .container { + /* Used to position the validation icon */ + position: relative; + } -.container__input { - /* Border */ - border: 1px solid rgba(0, 0, 0, 0.3); - border-radius: 4px; + .container__input { + /* Border */ + border: 1px solid rgba(0, 0, 0, 0.3); + border-radius: 4px; - /* Take the full width */ - width: 100%; + /* Take the full width */ + width: 100%; - /* Don't overlap the icon */ - padding-right: 24px; -} + /* Don't overlap the icon */ + padding-right: 24px; + } -.container__icon { - /* Positioned at the right side */ - position: absolute; - right: 8px; - top: 50%; - transform: translate(0, -50%); + .container__icon { + /* Positioned at the right side */ + position: absolute; + right: 8px; + top: 50%; + transform: translate(0, -50%); - z-index: 10; -} -`} + z-index: 10; + } + `} + > +
    -
    + - - - - - - -
    - -
    - - - - - - -
    + + +
    - -
    -
    + +
    + + + + + + +
    +
    + +
    ); }; diff --git a/pages/video-background/index.tsx b/pages/video-background/index.tsx index c829ec7..697e535 100644 --- a/pages/video-background/index.tsx +++ b/pages/video-background/index.tsx @@ -1,32 +1,27 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { return ( - + -
    -
    - In this pattern, the video is displayed in the background. -
    - + In this pattern, the video is displayed in the background. +
    +
    @@ -41,119 +36,119 @@ html={`
    `} -css={` -.container { - /* Used to position the video and content */ - position: relative; -} + css={` + .container { + /* Used to position the video and content */ + position: relative; + } -.container__wrapper { - /* Positioned at the top left corner */ - left: 0px; - position: absolute; - top: 0px; + .container__wrapper { + /* Positioned at the top left corner */ + left: 0px; + position: absolute; + top: 0px; - /* Take full size */ - height: 100%; - width: 100%; + /* Take full size */ + height: 100%; + width: 100%; - /* Hide the scrollbar */ - overflow: hidden; -} + /* Hide the scrollbar */ + overflow: hidden; + } -.container__video { - object-fit: cover; + .container__video { + object-fit: cover; - /* Center the video */ - left: 50%; - position: absolute; - top: 50%; - transform: translate(-50%, -50%); + /* Center the video */ + left: 50%; + position: absolute; + top: 50%; + transform: translate(-50%, -50%); - /* Take full width */ - width: 100%; -} + /* Take full width */ + width: 100%; + } -.container__content { - /* Positioned at the top left corner */ - left: 0px; - position: absolute; - top: 0px; + .container__content { + /* Positioned at the top left corner */ + left: 0px; + position: absolute; + top: 0px; - /* Take full size */ - height: 100%; - width: 100%; + /* Take full size */ + height: 100%; + width: 100%; - /* Center the content */ - align-items: center; - display: flex; - flex-direction: column; - justify-content: center; -} -`} + /* Center the content */ + align-items: center; + display: flex; + flex-direction: column; + justify-content: center; + } + `} + > +
    -
    -
    + autoPlay={true} + loop={true} + muted={true} + playsInline={true} + src="/assets/video-background-demo.mp4" + /> +
    -
    -
    - -
    +
    +
    +
    - -
    +
    + + - + ); }; diff --git a/pages/voting/index.tsx b/pages/voting/index.tsx index a9cbbeb..bf8aef3 100644 --- a/pages/voting/index.tsx +++ b/pages/voting/index.tsx @@ -1,14 +1,10 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; +import { Spacer } from '@1milligram/design'; import { RelatedPatterns } from '../../components/RelatedPatterns'; import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { @@ -17,16 +13,15 @@ const Details: React.FC<{}> = () => { const increase = () => setValue(value + 1); return ( - + -
    -
    `} -css={` -.voting { - border: 1px solid rgba(0, 0, 0, 0.3); - border-radius: 0.25rem; - display: flex; - flex-direction: column; - height: 8rem; -} + css={` + .voting { + border: 1px solid rgba(0, 0, 0, 0.3); + border-radius: 0.25rem; + display: flex; + flex-direction: column; + height: 8rem; + } -.voting__button { - /* Reset */ - background: none; - border: none; - cursor: pointer; - - /* Size */ - height: 1rem; + .voting__button { + /* Reset */ + background: none; + border: none; + cursor: pointer; - /* Position the triangle */ - position: relative; -} + /* Size */ + height: 1rem; -.voting__triangle { - border-style: solid; + /* Position the triangle */ + position: relative; + } - /* Size */ - height: 0; - width: 0; -} + .voting__triangle { + border-style: solid; -.voting__triangle--up { - border-color: transparent transparent rgba(0, 0, 0, 0.3); - border-width: 0 0.5rem 0.5rem; -} + /* Size */ + height: 0; + width: 0; + } -.voting__triangle--down { - border-color: rgba(0, 0, 0, 0.3) transparent transparent; - border-width: 0.5rem 0.5rem 0px; -} + .voting__triangle--up { + border-color: transparent transparent rgba(0, 0, 0, 0.3); + border-width: 0 0.5rem 0.5rem; + } -.voting__number { - /* Take the available height */ - flex: 1; + .voting__triangle--down { + border-color: rgba(0, 0, 0, 0.3) transparent transparent; + border-width: 0.5rem 0.5rem 0px; + } - /* Center the number */ - align-items: center; - display: flex; - justify-content: center; + .voting__number { + /* Take the available height */ + flex: 1; - /* Spacing */ - padding: 0.25rem; -} -`} + /* Center the number */ + align-items: center; + display: flex; + justify-content: center; + + /* Spacing */ + padding: 0.25rem; + } + `} + > +
    -
    -
    - {value} -
    - + /> + +
    + {value}
    +
    - -
    - - - +
    + + + +
    ); }; diff --git a/pages/watermark/index.tsx b/pages/watermark/index.tsx index 9ae70af..3f02b08 100644 --- a/pages/watermark/index.tsx +++ b/pages/watermark/index.tsx @@ -1,28 +1,22 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { return ( - + -
    -
    @@ -36,105 +30,104 @@ html={` ...
    `} -css={` -.container { - /* Used to position the watermark */ - position: relative; -} + css={` + .container { + /* Used to position the watermark */ + position: relative; + } -.container__wrapper { - /* Center the content */ - align-items: center; - display: flex; - justify-content: center; + .container__wrapper { + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; - /* Absolute position */ - left: 0px; - position: absolute; - top: 0px; + /* Absolute position */ + left: 0px; + position: absolute; + top: 0px; - /* Take full size */ - height: 100%; - width: 100%; -} + /* Take full size */ + height: 100%; + width: 100%; + } -.container__watermark { - /* Text color */ - color: rgba(0, 0, 0, 0.2); + .container__watermark { + /* Text color */ + color: rgba(0, 0, 0, 0.2); - /* Text styles */ - font-size: 3rem; - font-weight: bold; - text-transform: uppercase; + /* Text styles */ + font-size: 3rem; + font-weight: bold; + text-transform: uppercase; - /* Rotate the text */ - transform: rotate(-45deg); + /* Rotate the text */ + transform: rotate(-45deg); - /* Disable the selection */ - user-select: none; -} -`} + /* Disable the selection */ + user-select: none; + } + `} + > +
    -
    - Draft -
    -
    - -
    - -
    - -
    - -
    - -
    - + Draft
    + +
    + +
    + +
    + +
    + +
    + +
    - -
    - +
    + +
    ); }; diff --git a/pages/wizard/index.tsx b/pages/wizard/index.tsx index 858b771..7505b7d 100644 --- a/pages/wizard/index.tsx +++ b/pages/wizard/index.tsx @@ -1,13 +1,8 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { Pattern } from '../../constants/Pattern'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Circle from '../../placeholders/Circle'; @@ -15,16 +10,15 @@ import Line from '../../placeholders/Line'; const Details: React.FC<{}> = () => { return ( - + -
    -
    @@ -49,146 +43,153 @@ html={` ...
    `} -css={` -.wizard { - display: flex; -} + css={` + .wizard { + display: flex; + } -.wizard__step { - /* Make all steps have the same width */ - flex: 1; -} + .wizard__step { + /* Make all steps have the same width */ + flex: 1; + } -.wizard__dot { - /* Center the content */ - align-items: center; - display: flex; - justify-content: center; -} + .wizard__dot { + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; + } -.wizard__connector { - flex: 1; - height: 1px; - background-color: rgba(0, 0, 0, .3); -} + .wizard__connector { + flex: 1; + height: 1px; + background-color: rgba(0, 0, 0, 0.3); + } -.wizard__step:first-child .wizard__connector, -.wizard__step:last-child .wizard__connector { - background-color: transparent; -} + .wizard__step:first-child .wizard__connector, + .wizard__step:last-child .wizard__connector { + background-color: transparent; + } -.wizard__number { - /* Center the content */ - align-items: center; - display: flex; - justify-content: center; + .wizard__number { + /* Center the content */ + align-items: center; + display: flex; + justify-content: center; - /* Rounded border */ - background-color: rgba(0, 0, 0, .3); - border-radius: 9999px; - height: 32px; - width: 32px; + /* Rounded border */ + background-color: rgba(0, 0, 0, 0.3); + border-radius: 9999px; + height: 32px; + width: 32px; - /* OPTIONAL: Spacing between it and connectors */ - margin-left: 4px; - margin-right: 4px; -} -`} + /* OPTIONAL: Spacing between it and connectors */ + margin-left: 4px; + margin-right: 4px; + } + `} + > +
    -
    -
    -
    +
    +
    +
    +
    -
    -
    - -
    -
    +
    -
    - +
    +
    -
    +
    + +
    +
    +
    +
    +
    + +
    -
    -
    - -
    -
    +
    -
    - +
    +
    -
    +
    + +
    +
    +
    +
    +
    + +
    -
    -
    - -
    -
    -
    -
    - +
    +
    +
    +
    +
    - -
    - +
    + + ); }; diff --git a/pages/zigzag-timeline/index.tsx b/pages/zigzag-timeline/index.tsx index 2da8843..dfe70d2 100644 --- a/pages/zigzag-timeline/index.tsx +++ b/pages/zigzag-timeline/index.tsx @@ -1,23 +1,17 @@ -/** - * A collection of popular layouts and patterns made with CSS (https://csslayout.io) - * (c) 2019 - 2021 Nguyen Huu Phuoc - */ - import * as React from 'react'; import Head from 'next/head'; -import { Pattern } from '../../constants/Pattern'; +import { Spacer } from '@1milligram/design'; +import { Pattern } from '../../constants/Pattern'; import { RelatedPatterns } from '../../components/RelatedPatterns'; -import { DetailsLayout } from '../../layouts/DetailsLayout'; +import { PatternLayout } from '../../layouts/PatternLayout'; import Block from '../../placeholders/Block'; import BrowserFrame from '../../placeholders/BrowserFrame'; import Rectangle from '../../placeholders/Rectangle'; -import './zigzag-timeline.css'; - const Details: React.FC<{}> = () => { return ( - + @@ -25,7 +19,7 @@ const Details: React.FC<{}> = () => {
    ...
    @@ -37,51 +31,50 @@ html={` ... `} -css={` -.zigzag-timeline__item { - /* Used to position the milestone */ - position: relative; + css={` + .zigzag-timeline__item { + /* Used to position the milestone */ + position: relative; - /* Border */ - border-bottom: 1px solid #71717A; + /* Border */ + border-bottom: 1px solid #71717a; - /* Take full width */ - width: 100%; -} + /* Take full width */ + width: 100%; + } -.zigzag-timeline__milestone { - /* Absolute position */ - position: absolute; - top: 50%; + .zigzag-timeline__milestone { + /* Absolute position */ + position: absolute; + top: 50%; - /* Circle it */ - border-radius: 50%; - height: 2rem; - width: 2rem; + /* Circle it */ + border-radius: 50%; + height: 2rem; + width: 2rem; - /* Misc */ - background: #71717A; -} + /* Misc */ + background: #71717a; + } -/* Styles for even items */ -.zigzag-timeline__item:nth-child(2n) { - border-left: 1px solid #71717A; - -} -.zigzag-timeline__item:nth-child(2n) .zigzag-timeline__milestone { - left: 0; - transform: translate(-50%, -50%); -} + /* Styles for even items */ + .zigzag-timeline__item:nth-child(2n) { + border-left: 1px solid #71717a; + } + .zigzag-timeline__item:nth-child(2n) .zigzag-timeline__milestone { + left: 0; + transform: translate(-50%, -50%); + } -/* Styles for odd items */ -.zigzag-timeline__item:nth-child(2n + 1) { - border-right: 1px solid #71717A; -} -.zigzag-timeline__item:nth-child(2n + 1) .zigzag-timeline__milestone { - right: 0; - transform: translate(50%, -50%); -} -`} + /* Styles for odd items */ + .zigzag-timeline__item:nth-child(2n + 1) { + border-right: 1px solid #71717a; + } + .zigzag-timeline__item:nth-child(2n + 1) .zigzag-timeline__milestone { + right: 0; + transform: translate(50%, -50%); + } + `} >
    -
    -
    +
    +
    + +
    -
    -
    +
    +
    + +
    -
    -
    +
    +
    + +
    + - + ); }; diff --git a/patterns/accordion/Cover.tsx b/patterns/accordion/Cover.tsx index 695a2ab..83336b3 100644 --- a/patterns/accordion/Cover.tsx +++ b/patterns/accordion/Cover.tsx @@ -40,7 +40,7 @@ const Cover: React.FC<{}> = () => { }} >
    - +
    @@ -56,7 +56,7 @@ const Cover: React.FC<{}> = () => { }} >
    - +
    @@ -64,8 +64,12 @@ const Cover: React.FC<{}> = () => {
    -
    -
    +
    + +
    +
    + +
    diff --git a/patterns/avatar-list/Cover.tsx b/patterns/avatar-list/Cover.tsx index 787b8b7..7b2f244 100644 --- a/patterns/avatar-list/Cover.tsx +++ b/patterns/avatar-list/Cover.tsx @@ -19,8 +19,9 @@ const Cover: React.FC<{}> = () => { padding: '8px', }} > - { - Array(3).fill(null).map((_, i) => { + {Array(3) + .fill(null) + .map((_, i) => { return (
    = () => {
    ); - }) - } + })}
    ); diff --git a/patterns/avatar/Cover.tsx b/patterns/avatar/Cover.tsx index ae747f5..a2fe4c4 100644 --- a/patterns/avatar/Cover.tsx +++ b/patterns/avatar/Cover.tsx @@ -34,7 +34,7 @@ const Cover: React.FC<{}> = () => { style={{ fill: 'none', height: '100%', - stroke: "#FFF", + stroke: '#FFF', strokeLinecap: 'round', strokeLinejoin: 'round', strokeWidth: 1, diff --git a/patterns/breadcrumb/Cover.tsx b/patterns/breadcrumb/Cover.tsx index e739b09..6afc9ab 100644 --- a/patterns/breadcrumb/Cover.tsx +++ b/patterns/breadcrumb/Cover.tsx @@ -30,11 +30,17 @@ const Cover: React.FC<{}> = () => { width: '80%', }} > -
    +
    + +
    /
    -
    +
    + +
    /
    -
    +
    + +
    diff --git a/patterns/button-with-icon/Cover.tsx b/patterns/button-with-icon/Cover.tsx index b37d4b0..5a7bdc5 100644 --- a/patterns/button-with-icon/Cover.tsx +++ b/patterns/button-with-icon/Cover.tsx @@ -32,7 +32,9 @@ const Cover: React.FC<{}> = () => { width: '100%', }} > -
    +
    + +
    diff --git a/patterns/card-layout/Cover.tsx b/patterns/card-layout/Cover.tsx index 53147b4..74f946d 100644 --- a/patterns/card-layout/Cover.tsx +++ b/patterns/card-layout/Cover.tsx @@ -22,15 +22,15 @@ const Cover: React.FC<{}> = () => { }} >
    - { - Array(9).fill(0).map((_, index) => { + {Array(9) + .fill(0) + .map((_, index) => { return (
    ); - }) - } + })}
    diff --git a/patterns/card/Cover.tsx b/patterns/card/Cover.tsx index 57b798d..89fff53 100644 --- a/patterns/card/Cover.tsx +++ b/patterns/card/Cover.tsx @@ -24,10 +24,18 @@ const Cover: React.FC<{}> = () => {
    -
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    diff --git a/patterns/chip/InputChip.tsx b/patterns/chip/InputChip.tsx index ea8748d..f197878 100644 --- a/patterns/chip/InputChip.tsx +++ b/patterns/chip/InputChip.tsx @@ -17,9 +17,7 @@ const InputChip: React.FC<{}> = ({ children }) => { padding: '4px 8px', }} > -
    - {children} -
    +
    {children}
    diff --git a/patterns/drop-area/Cover.tsx b/patterns/drop-area/Cover.tsx index d673a98..5117f9c 100644 --- a/patterns/drop-area/Cover.tsx +++ b/patterns/drop-area/Cover.tsx @@ -33,9 +33,15 @@ const Cover: React.FC<{}> = () => { width: '100%', }} > -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    diff --git a/patterns/drop-cap/Cover.tsx b/patterns/drop-cap/Cover.tsx index ebdd68f..b7373ee 100644 --- a/patterns/drop-cap/Cover.tsx +++ b/patterns/drop-cap/Cover.tsx @@ -36,21 +36,45 @@ const Cover: React.FC<{}> = () => {
    -
    -
    -
    -
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    -
    -
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    diff --git a/patterns/drop-cap/dropcap.css b/patterns/drop-cap/dropcap.css index b12883d..c59c774 100644 --- a/patterns/drop-cap/dropcap.css +++ b/patterns/drop-cap/dropcap.css @@ -10,5 +10,5 @@ font-weight: 700; line-height: 1; margin: 0 8px 0 0; - padding: 0 8px; + padding: 0 8px; } diff --git a/patterns/dropdown/Cover.tsx b/patterns/dropdown/Cover.tsx index 2ebf3b5..e36476b 100644 --- a/patterns/dropdown/Cover.tsx +++ b/patterns/dropdown/Cover.tsx @@ -34,7 +34,7 @@ const Cover: React.FC<{}> = () => { width: '60%', }} > - +
    = () => { padding: '0 4px', }} > -
    +
    + +
    = () => { padding: '0 4px', }} > -
    +
    + +
    diff --git a/patterns/fading-long-section/Cover.tsx b/patterns/fading-long-section/Cover.tsx index 50b02b2..87fcaba 100644 --- a/patterns/fading-long-section/Cover.tsx +++ b/patterns/fading-long-section/Cover.tsx @@ -30,15 +30,15 @@ const Cover: React.FC<{}> = () => { width: '100%', }} > - { - Array(20).fill(0).map((_, index) => { + {Array(20) + .fill(0) + .map((_, index) => { return (
    ); - }) - } + })}
    = () => { }} >
    -
    +
    + +
    -
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    -
    +
    + +
    -
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    diff --git a/patterns/floating-label/floating-label.css b/patterns/floating-label/floating-label.css index 9fef476..98e4193 100644 --- a/patterns/floating-label/floating-label.css +++ b/patterns/floating-label/floating-label.css @@ -8,7 +8,7 @@ } .p-floating-container input:not(:placeholder-shown) + label { - background: #FFF; + background: #fff; transform: translate(0, -50%); opacity: 1; } diff --git a/patterns/folder-structure/folder-structure.css b/patterns/folder-structure/folder-structure.css index 502cec5..9117cdc 100644 --- a/patterns/folder-structure/folder-structure.css +++ b/patterns/folder-structure/folder-structure.css @@ -21,9 +21,9 @@ } .folder-structure li::before { - border-left: 1px solid rgba(0, 0, 0, .3); + border-left: 1px solid rgba(0, 0, 0, 0.3); content: ''; - + /* Position */ left: 0; position: absolute; @@ -35,7 +35,7 @@ } .folder-structure li::after { - border-bottom: 1px solid rgba(0, 0, 0, .3); + border-bottom: 1px solid rgba(0, 0, 0, 0.3); content: ''; /* Position */ diff --git a/patterns/full-background/Cover.tsx b/patterns/full-background/Cover.tsx index d52bb2a..0962f64 100644 --- a/patterns/full-background/Cover.tsx +++ b/patterns/full-background/Cover.tsx @@ -23,13 +23,13 @@ const Cover: React.FC<{}> = () => { }} >
    - +
    - +
    - +
    diff --git a/patterns/full-screen-menu/Cover.tsx b/patterns/full-screen-menu/Cover.tsx index 4ac2a84..71b2d9c 100644 --- a/patterns/full-screen-menu/Cover.tsx +++ b/patterns/full-screen-menu/Cover.tsx @@ -41,9 +41,15 @@ const Cover: React.FC<{}> = () => { width: '100%', }} > -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    diff --git a/patterns/holy-grail/Cover.tsx b/patterns/holy-grail/Cover.tsx index 7ccc0e0..eee4907 100644 --- a/patterns/holy-grail/Cover.tsx +++ b/patterns/holy-grail/Cover.tsx @@ -32,9 +32,15 @@ const Cover: React.FC<{}> = () => { width: '100%', }} > -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    @@ -45,17 +51,33 @@ const Cover: React.FC<{}> = () => { width: '30%', }} > -
    -
    +
    + +
    +
    + +
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    = () => { width: '30%', }} > -
    -
    +
    + +
    +
    + +
    = () => { width: '100%', }} > -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    diff --git a/patterns/input-addon/Cover.tsx b/patterns/input-addon/Cover.tsx index 5b653bf..5ee68a1 100644 --- a/patterns/input-addon/Cover.tsx +++ b/patterns/input-addon/Cover.tsx @@ -39,7 +39,9 @@ const Cover: React.FC<{}> = () => { width: '30%', }} > -
    +
    + +
    diff --git a/patterns/inverted-corners/inverted-corners.css b/patterns/inverted-corners/inverted-corners.css index b9b022b..7a64565 100644 --- a/patterns/inverted-corners/inverted-corners.css +++ b/patterns/inverted-corners/inverted-corners.css @@ -4,13 +4,13 @@ */ :root { - --inverted-corners-background: #52525B; + --inverted-corners-background: #52525b; --inverted-corners-size: 2rem; } .inverted-corners { background-color: var(--inverted-corners-background); - + /* Used to position the corner */ position: relative; @@ -49,5 +49,5 @@ justify-content: center; /* Misc */ - color: #FFF; -} \ No newline at end of file + color: #fff; +} diff --git a/patterns/layered-card/styles.css b/patterns/layered-card/styles.css index 4295d5a..04d7913 100644 --- a/patterns/layered-card/styles.css +++ b/patterns/layered-card/styles.css @@ -10,7 +10,7 @@ .layered-card::before { background: rgba(0, 0, 0, 0.3); content: ''; - + /* Position */ top: 0; left: 0; diff --git a/patterns/masonry-grid/Cover.tsx b/patterns/masonry-grid/Cover.tsx index 74a8e8d..2bfe9f9 100644 --- a/patterns/masonry-grid/Cover.tsx +++ b/patterns/masonry-grid/Cover.tsx @@ -25,17 +25,33 @@ const Cover: React.FC<{}> = () => { style={{ columnCount: 3, columnGap: '0.25rem', - width: '80%' + width: '80%', }} > -
    -
    -
    -
    -
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    diff --git a/patterns/media-object/Cover.tsx b/patterns/media-object/Cover.tsx index 6b78fdb..c77259d 100644 --- a/patterns/media-object/Cover.tsx +++ b/patterns/media-object/Cover.tsx @@ -25,17 +25,35 @@ const Cover: React.FC<{}> = () => {
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    diff --git a/patterns/mega-menu/Cover.tsx b/patterns/mega-menu/Cover.tsx index 7135250..3aed34a 100644 --- a/patterns/mega-menu/Cover.tsx +++ b/patterns/mega-menu/Cover.tsx @@ -52,23 +52,47 @@ const Cover: React.FC<{}> = () => { }} >
    -
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    -
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    -
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    diff --git a/patterns/menu/Cover.tsx b/patterns/menu/Cover.tsx index ea3906d..5a8f097 100644 --- a/patterns/menu/Cover.tsx +++ b/patterns/menu/Cover.tsx @@ -51,7 +51,9 @@ const Cover: React.FC<{}> = () => { padding: '0 8px', }} > -
    +
    + +
    = () => { padding: '0 8px', }} > -
    +
    + +
    diff --git a/patterns/modal/Cover.tsx b/patterns/modal/Cover.tsx index 39b8673..9f643d1 100644 --- a/patterns/modal/Cover.tsx +++ b/patterns/modal/Cover.tsx @@ -37,14 +37,24 @@ const Cover: React.FC<{}> = () => { padding: '0 4px', }} > -
    +
    + +
    ×
    -
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    = () => { padding: '4px', }} > -
    -
    +
    + +
    +
    + +
    diff --git a/patterns/nested-dropdowns/Cover.tsx b/patterns/nested-dropdowns/Cover.tsx index ab68f44..55fd9d1 100644 --- a/patterns/nested-dropdowns/Cover.tsx +++ b/patterns/nested-dropdowns/Cover.tsx @@ -58,10 +58,18 @@ const Cover: React.FC<{}> = () => { width: '100%', }} > -
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    = () => { width: '80%', }} > -
    +
    + +
    ×
    diff --git a/patterns/overlay-play-button/Cover.tsx b/patterns/overlay-play-button/Cover.tsx index e882318..de24313 100644 --- a/patterns/overlay-play-button/Cover.tsx +++ b/patterns/overlay-play-button/Cover.tsx @@ -51,7 +51,7 @@ const Cover: React.FC<{}> = () => { width: '32px', }} > - +
    diff --git a/patterns/price-tag/Cover.tsx b/patterns/price-tag/Cover.tsx index e7834cf..a71b8bc 100644 --- a/patterns/price-tag/Cover.tsx +++ b/patterns/price-tag/Cover.tsx @@ -29,8 +29,8 @@ const Cover: React.FC<{}> = () => { justifyContent: 'center', position: 'relative', width: '100%', - } - }> + }} + >
    = () => { padding: '4px', }} > -
    +
    + +
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    @@ -56,13 +64,25 @@ const Cover: React.FC<{}> = () => { padding: '4px', }} > -
    +
    + +
    -
    -
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    @@ -78,10 +98,16 @@ const Cover: React.FC<{}> = () => { padding: '4px', }} > -
    +
    + +
    -
    -
    +
    + +
    +
    + +
    diff --git a/patterns/property-list/Cover.tsx b/patterns/property-list/Cover.tsx index ed3b391..e3532e2 100644 --- a/patterns/property-list/Cover.tsx +++ b/patterns/property-list/Cover.tsx @@ -32,7 +32,9 @@ const Cover: React.FC<{}> = () => { padding: '4px 0', }} > -
    +
    + +
    = () => { padding: '4px 0', }} > -
    +
    + +
    = () => { padding: '4px 0', }} > -
    +
    + +
    diff --git a/patterns/questions-and-answers/Cover.tsx b/patterns/questions-and-answers/Cover.tsx index 5949d9b..48f34da 100644 --- a/patterns/questions-and-answers/Cover.tsx +++ b/patterns/questions-and-answers/Cover.tsx @@ -32,7 +32,9 @@ const Cover: React.FC<{}> = () => { marginBottom: '8px', }} > -
    +
    + +
    @@ -44,13 +46,23 @@ const Cover: React.FC<{}> = () => { marginBottom: '4px', }} > -
    +
    + +
    -
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    diff --git a/patterns/rating/Star.tsx b/patterns/rating/Star.tsx index 428d112..c2546b5 100644 --- a/patterns/rating/Star.tsx +++ b/patterns/rating/Star.tsx @@ -12,11 +12,7 @@ interface StarProps { } const Star: React.FC = ({ isActive }) => { - return ( - - ); + return ; }; export default Star; diff --git a/patterns/same-height-columns/Cover.tsx b/patterns/same-height-columns/Cover.tsx index 236199b..54fc4db 100644 --- a/patterns/same-height-columns/Cover.tsx +++ b/patterns/same-height-columns/Cover.tsx @@ -17,21 +17,39 @@ const Cover: React.FC<{}> = () => {
    -
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    -
    -
    +
    + +
    +
    + +
    diff --git a/patterns/separator/Cover.tsx b/patterns/separator/Cover.tsx index 726dcb5..2b36c8f 100644 --- a/patterns/separator/Cover.tsx +++ b/patterns/separator/Cover.tsx @@ -30,9 +30,15 @@ const Cover: React.FC<{}> = () => { width: '80%', }} > -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    diff --git a/patterns/sidebar/Cover.tsx b/patterns/sidebar/Cover.tsx index b2afd6a..c8b78f8 100644 --- a/patterns/sidebar/Cover.tsx +++ b/patterns/sidebar/Cover.tsx @@ -22,8 +22,12 @@ const Cover: React.FC<{}> = () => { width: '30%', }} > -
    -
    +
    + +
    +
    + +
    = () => { padding: '8px', }} > -
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    diff --git a/patterns/simple-grid/Cover.tsx b/patterns/simple-grid/Cover.tsx index 530cabe..315fd9e 100644 --- a/patterns/simple-grid/Cover.tsx +++ b/patterns/simple-grid/Cover.tsx @@ -23,18 +23,34 @@ const Cover: React.FC<{}> = () => { >
    -
    -
    +
    + +
    +
    + +
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    diff --git a/patterns/slider/Cover.tsx b/patterns/slider/Cover.tsx index 2112be3..99c0fd7 100644 --- a/patterns/slider/Cover.tsx +++ b/patterns/slider/Cover.tsx @@ -30,9 +30,13 @@ const Cover: React.FC<{}> = () => { width: '80%', }} > -
    +
    + +
    -
    +
    + +
    diff --git a/patterns/spin-button/Cover.tsx b/patterns/spin-button/Cover.tsx index f40f16f..5505591 100644 --- a/patterns/spin-button/Cover.tsx +++ b/patterns/spin-button/Cover.tsx @@ -37,8 +37,12 @@ const Cover: React.FC<{}> = () => { justifyContent: 'center', }} > -
    -
    +
    + +
    +
    + +
    diff --git a/patterns/split-navigation/Cover.tsx b/patterns/split-navigation/Cover.tsx index cb16c18..8e12eaa 100644 --- a/patterns/split-navigation/Cover.tsx +++ b/patterns/split-navigation/Cover.tsx @@ -31,9 +31,15 @@ const Cover: React.FC<{}> = () => { width: '100%', }} > -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    diff --git a/patterns/split-screen/Cover.tsx b/patterns/split-screen/Cover.tsx index 9a1b097..5e07615 100644 --- a/patterns/split-screen/Cover.tsx +++ b/patterns/split-screen/Cover.tsx @@ -23,7 +23,9 @@ const Cover: React.FC<{}> = () => { justifyContent: 'center', }} > -
    +
    + +
    = () => { }} >
    -
    -
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    diff --git a/patterns/statistic/Cover.tsx b/patterns/statistic/Cover.tsx index cec31ad..785dcfa 100644 --- a/patterns/statistic/Cover.tsx +++ b/patterns/statistic/Cover.tsx @@ -28,9 +28,7 @@ const Cover: React.FC<{}> = () => { justifyContent: 'center', }} > -
    - 1k+ -
    +
    1k+
    stars
    diff --git a/patterns/sticky-footer/Cover.tsx b/patterns/sticky-footer/Cover.tsx index 9135631..cb3f870 100644 --- a/patterns/sticky-footer/Cover.tsx +++ b/patterns/sticky-footer/Cover.tsx @@ -33,9 +33,15 @@ const Cover: React.FC<{}> = () => { width: '100%', }} > -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    = () => { }} >
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    @@ -60,9 +72,15 @@ const Cover: React.FC<{}> = () => { width: '100%', }} > -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    diff --git a/patterns/sticky-header/Cover.tsx b/patterns/sticky-header/Cover.tsx index ce207e9..f5355c2 100644 --- a/patterns/sticky-header/Cover.tsx +++ b/patterns/sticky-header/Cover.tsx @@ -27,9 +27,15 @@ const Cover: React.FC<{}> = () => { width: '100%', }} > -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    @@ -41,9 +47,15 @@ const Cover: React.FC<{}> = () => { }} >
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    diff --git a/patterns/sticky-table-column/Cover.tsx b/patterns/sticky-table-column/Cover.tsx index 7560501..9116e14 100644 --- a/patterns/sticky-table-column/Cover.tsx +++ b/patterns/sticky-table-column/Cover.tsx @@ -31,8 +31,9 @@ const Cover: React.FC<{}> = () => { > - { - Array(3).fill(0).map((_, index) => { + {Array(3) + .fill(0) + .map((_, index) => { return ( = () => { {index === 0 ? : } ); - }) - } + })} - { - Array(2).fill(0).map((_, row) => { + {Array(2) + .fill(0) + .map((_, row) => { return ( - { - Array(3).fill(0).map((__, col) => { + {Array(3) + .fill(0) + .map((__, col) => { return ( = () => { {col === 0 ? : } ); - }) - } + })} ); - }) - } + })}
    diff --git a/patterns/sticky-table-headers/Cover.tsx b/patterns/sticky-table-headers/Cover.tsx index cf8d82f..2424ca0 100644 --- a/patterns/sticky-table-headers/Cover.tsx +++ b/patterns/sticky-table-headers/Cover.tsx @@ -31,35 +31,35 @@ const Cover: React.FC<{}> = () => { > - { - Array(3).fill(0).map((_, index) => { + {Array(3) + .fill(0) + .map((_, index) => { return ( ); - }) - } + })} - { - Array(3).fill(0).map((_, row) => { + {Array(3) + .fill(0) + .map((_, row) => { return ( - { - Array(3).fill(0).map((__, col) => { + {Array(3) + .fill(0) + .map((__, col) => { return ( ); - }) - } + })} ); - }) - } + })}
    diff --git a/patterns/three-dimensions-card/Cover.tsx b/patterns/three-dimensions-card/Cover.tsx index 8ebd589..7abdf58 100644 --- a/patterns/three-dimensions-card/Cover.tsx +++ b/patterns/three-dimensions-card/Cover.tsx @@ -25,8 +25,8 @@ const Cover: React.FC<{}> = () => { height: '2rem', position: 'relative', width: '100%', - } - }> + }} + >
    = () => { style={{ background: 'rgba(0, 0, 0, 0.3)', bottom: 0, - height: '0.5rem', + height: '0.5rem', left: 0, position: 'absolute', transform: 'translate(0, 100%) skewX(-45deg)', diff --git a/patterns/three-dimensions-card/styles.css b/patterns/three-dimensions-card/styles.css index 41f9ab6..6fcd4a8 100644 --- a/patterns/three-dimensions-card/styles.css +++ b/patterns/three-dimensions-card/styles.css @@ -12,10 +12,10 @@ } /* The left side */ -.three-dimensions-card::before { +.three-dimensions-card::before { background: rgba(0, 0, 0, 0.3); content: ''; - + /* Position */ top: var(--three-dimensions-card-left-side-width); left: 0px; @@ -31,8 +31,8 @@ /* The bottom side */ .three-dimensions-card::after { background: rgba(0, 0, 0, 0.3); - content: ''; - + content: ''; + /* Position */ bottom: 0px; left: 0px; diff --git a/patterns/timeline/Cover.tsx b/patterns/timeline/Cover.tsx index b99994a..bb0cdcf 100644 --- a/patterns/timeline/Cover.tsx +++ b/patterns/timeline/Cover.tsx @@ -47,30 +47,50 @@ const Cover: React.FC<{}> = () => { >
  • - +
    -
    +
    + +
    -
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    +
    + +
  • - +
    -
    +
    + +
    -
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    +
    + +
  • diff --git a/patterns/toggle-password-visibility/Cover.tsx b/patterns/toggle-password-visibility/Cover.tsx index c8bdf5f..63673cd 100644 --- a/patterns/toggle-password-visibility/Cover.tsx +++ b/patterns/toggle-password-visibility/Cover.tsx @@ -33,9 +33,15 @@ const Cover: React.FC<{}> = () => { }} >
    -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    diff --git a/patterns/tree-diagram/Cover.tsx b/patterns/tree-diagram/Cover.tsx index 7d8a2d9..2eed0a9 100644 --- a/patterns/tree-diagram/Cover.tsx +++ b/patterns/tree-diagram/Cover.tsx @@ -20,10 +20,7 @@ const Cover: React.FC<{}> = () => { padding: '0.5rem', }} > -
    +
    = () => { style={{ fill: 'none', height: '16px', - stroke: "rgba(0, 0, 0, 0.4)", + stroke: 'rgba(0, 0, 0, 0.4)', strokeLinecap: 'round', strokeLinejoin: 'round', strokeWidth: 1, diff --git a/patterns/validation-icon/Cover.tsx b/patterns/validation-icon/Cover.tsx index e188fee..b14f0bd 100644 --- a/patterns/validation-icon/Cover.tsx +++ b/patterns/validation-icon/Cover.tsx @@ -42,7 +42,7 @@ const Cover: React.FC<{}> = () => { style={{ fill: 'none', height: '16px', - stroke: "rgba(0, 0, 0, 0.5)", + stroke: 'rgba(0, 0, 0, 0.5)', strokeLinecap: 'round', strokeLinejoin: 'round', strokeWidth: 1, diff --git a/patterns/video-background/Cover.tsx b/patterns/video-background/Cover.tsx index d52bb2a..0962f64 100644 --- a/patterns/video-background/Cover.tsx +++ b/patterns/video-background/Cover.tsx @@ -23,13 +23,13 @@ const Cover: React.FC<{}> = () => { }} >
    - +
    - +
    - +
    diff --git a/patterns/wizard/Cover.tsx b/patterns/wizard/Cover.tsx index e4f4cb9..a90e379 100644 --- a/patterns/wizard/Cover.tsx +++ b/patterns/wizard/Cover.tsx @@ -46,7 +46,9 @@ const Cover: React.FC<{}> = () => { > 1
    -
    +
    + +
    = () => { justifyContent: 'center', }} > -
    +
    + +
    = () => { > 2
    -
    +
    + +
    = () => { justifyContent: 'center', }} > -
    +
    + +
    = () => { width: '.75rem', }} /> -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    = () => { borderRadius: '50%', height: '.75rem', left: 0, - position: 'absolute', + position: 'absolute', top: '50%', transform: 'translate(-50%, -50%)', width: '.75rem', }} /> -
    -
    -
    +
    + +
    +
    + +
    +
    + +
    diff --git a/patterns/zigzag-timeline/zigzag-timeline.css b/patterns/zigzag-timeline/zigzag-timeline.css index 46cbfde..5e45f4f 100644 --- a/patterns/zigzag-timeline/zigzag-timeline.css +++ b/patterns/zigzag-timeline/zigzag-timeline.css @@ -8,7 +8,7 @@ position: relative; /* Border */ - border-bottom: 1px solid #71717A; + border-bottom: 1px solid #71717a; /* Take full width */ width: 100%; @@ -16,7 +16,7 @@ .zigzag-timeline__milestone { /* Absolute position */ - position: absolute; + position: absolute; top: 50%; /* Circle it */ @@ -25,24 +25,23 @@ width: 2rem; /* Misc */ - background: #71717A; + background: #71717a; } /* Styles for even items */ .zigzag-timeline__item:nth-child(2n) { - border-left: 1px solid #71717A; - + border-left: 1px solid #71717a; } .zigzag-timeline__item:nth-child(2n) .zigzag-timeline__milestone { left: 0; - transform: translate(-50%, -50%); + transform: translate(-50%, -50%); } /* Styles for odd items */ .zigzag-timeline__item:nth-child(2n + 1) { - border-right: 1px solid #71717A; + border-right: 1px solid #71717a; } .zigzag-timeline__item:nth-child(2n + 1) .zigzag-timeline__milestone { right: 0; transform: translate(50%, -50%); -} \ No newline at end of file +} diff --git a/placeholders/Block.tsx b/placeholders/Block.tsx index 33113bb..35680ab 100644 --- a/placeholders/Block.tsx +++ b/placeholders/Block.tsx @@ -29,8 +29,9 @@ const Block: React.FC = ({ width: '100%', }} > - { - Array(numberOfBlocks).fill(0).map((_, i) => { + {Array(numberOfBlocks) + .fill(0) + .map((_, i) => { const s = random(1, 5); return (
    = ({ />
    ); - }) - } + })}
    ); }; diff --git a/placeholders/BrowserFrame.tsx b/placeholders/BrowserFrame.tsx index c77d4d9..a406012 100644 --- a/placeholders/BrowserFrame.tsx +++ b/placeholders/BrowserFrame.tsx @@ -4,27 +4,26 @@ */ import * as React from 'react'; +import { Window } from '@1milligram/design'; import { Code } from '../components/Code'; interface BrowserFrameProps { css: string; - html: string; + html: string; } const BrowserFrame: React.FC = ({ children, css, html }) => { return ( - <> +
    {html}
    {css}
    -
    - {children} -
    - +
    {children}
    +
    ); }; diff --git a/placeholders/Circle.tsx b/placeholders/Circle.tsx index 228d1bc..8e1f71c 100644 --- a/placeholders/Circle.tsx +++ b/placeholders/Circle.tsx @@ -10,10 +10,7 @@ interface CircleProps { size?: number; } -const Circle: React.FC = ({ - backgroundColor = 'rgba(0, 0, 0, .3)', - size = 16, -}) => { +const Circle: React.FC = ({ backgroundColor = 'rgba(0, 0, 0, .3)', size = 16 }) => { return (
    = ({ - backgroundColor = 'rgba(0, 0, 0, 0.3)', -}) => { +const Line: React.FC = ({ backgroundColor = 'rgba(0, 0, 0, 0.3)' }) => { return (
    = ({ - backgroundColor = 'rgba(0, 0, 0, 0.3)', - size = '100%', -}) => { +const Square: React.FC = ({ backgroundColor = 'rgba(0, 0, 0, 0.3)', size = '100%' }) => { return (
    = ({ - backgroundColor = 'rgba(0, 0, 0, .3)', - size = 16, - corner = 'tl', -}) => { +const Triangle: React.FC = ({ backgroundColor = 'rgba(0, 0, 0, .3)', size = 16, corner = 'tl' }) => { let bw = ''; let bc = ''; switch (corner) { diff --git a/styles/blocks/_ad.scss b/styles/blocks/_ad.scss new file mode 100644 index 0000000..01e7eb2 --- /dev/null +++ b/styles/blocks/_ad.scss @@ -0,0 +1,22 @@ +.block-ad { + background: #e6e6e6; + border-radius: 0.25rem; + padding: 1rem; + margin: 0 auto; + max-width: 15rem; +} + +/* Ads */ +.carbon-img { + display: block; + text-align: center; +} +.carbon-poweredby { + display: block; + font-size: 0.75rem; + text-align: right; +} +.carbon-text { + display: block; + font-size: 0.875rem; +} diff --git a/styles/blocks/_browser-frame.scss b/styles/blocks/_browser-frame.scss index 188aaac..997741f 100644 --- a/styles/blocks/_browser-frame.scss +++ b/styles/blocks/_browser-frame.scss @@ -4,11 +4,10 @@ */ .demo__live { - border: 1px solid rgba(0, 0, 0, 0.2); height: 32rem; overflow: auto; } .demo__html { border-bottom: 1px solid rgba(0, 0, 0, 0.5); -} \ No newline at end of file +} diff --git a/styles/blocks/_code.scss b/styles/blocks/_code.scss new file mode 100644 index 0000000..51ca443 --- /dev/null +++ b/styles/blocks/_code.scss @@ -0,0 +1,8 @@ +.block-code { + font-size: 0.875rem; + font-family: 'Source code pro'; + height: auto; + margin: 0; + overflow: auto; + padding: 1em; +} diff --git a/styles/index.scss b/styles/index.scss index 0c41a96..8619a0d 100644 --- a/styles/index.scss +++ b/styles/index.scss @@ -1,7 +1,9 @@ @import './reset'; // Blocks -@import 'blocks/_browser-frame'; +@import 'blocks/ad'; +@import 'blocks/browser-frame'; +@import 'blocks/code'; @import 'blocks/cover'; @import 'blocks/footer'; @import 'blocks/header'; @@ -28,4 +30,4 @@ @import 'patterns/three-dimensions-card'; @import 'patterns/tooltip'; @import 'patterns/tree-diagram'; -@import 'patterns/zigzag-timeline'; \ No newline at end of file +@import 'patterns/zigzag-timeline'; diff --git a/styles/pages/_home.scss b/styles/pages/_home.scss index 69d62a9..76a3429 100644 --- a/styles/pages/_home.scss +++ b/styles/pages/_home.scss @@ -25,4 +25,4 @@ .page-home__collection { display: flex; flex-wrap: wrap; -} \ No newline at end of file +} diff --git a/styles/patterns/_concave-corners.scss b/styles/patterns/_concave-corners.scss index c7155ae..0c6b66e 100644 --- a/styles/patterns/_concave-corners.scss +++ b/styles/patterns/_concave-corners.scss @@ -4,13 +4,13 @@ */ :root { - --concave-corners-background: rgba(0, 0, 0, .3); + --concave-corners-background: rgba(0, 0, 0, 0.3); --concave-corners-size: 1rem; } .concave-corners { background-color: var(--concave-corners-background); - + /* Used to position the corners */ position: relative; @@ -23,10 +23,10 @@ position: absolute; /* Size */ - height: var(--concave-corners-size); + height: var(--concave-corners-size); width: var(--concave-corners-size); - background: #FFF; + background: #fff; } .concave-corners__corner--tl { @@ -39,7 +39,7 @@ } .concave-corners__corner--tr { - /* Position */ + /* Position */ right: 0; top: 0; @@ -63,4 +63,4 @@ /* Border radius */ border-radius: var(--concave-corners-size) 0 0 0; -} \ No newline at end of file +} diff --git a/styles/patterns/_dropcap.scss b/styles/patterns/_dropcap.scss index b12883d..c59c774 100644 --- a/styles/patterns/_dropcap.scss +++ b/styles/patterns/_dropcap.scss @@ -10,5 +10,5 @@ font-weight: 700; line-height: 1; margin: 0 8px 0 0; - padding: 0 8px; + padding: 0 8px; } diff --git a/styles/patterns/_floating-label.scss b/styles/patterns/_floating-label.scss index 9fef476..98e4193 100644 --- a/styles/patterns/_floating-label.scss +++ b/styles/patterns/_floating-label.scss @@ -8,7 +8,7 @@ } .p-floating-container input:not(:placeholder-shown) + label { - background: #FFF; + background: #fff; transform: translate(0, -50%); opacity: 1; } diff --git a/styles/patterns/_folder-structure.scss b/styles/patterns/_folder-structure.scss index 502cec5..9117cdc 100644 --- a/styles/patterns/_folder-structure.scss +++ b/styles/patterns/_folder-structure.scss @@ -21,9 +21,9 @@ } .folder-structure li::before { - border-left: 1px solid rgba(0, 0, 0, .3); + border-left: 1px solid rgba(0, 0, 0, 0.3); content: ''; - + /* Position */ left: 0; position: absolute; @@ -35,7 +35,7 @@ } .folder-structure li::after { - border-bottom: 1px solid rgba(0, 0, 0, .3); + border-bottom: 1px solid rgba(0, 0, 0, 0.3); content: ''; /* Position */ diff --git a/styles/patterns/_inverted-corners.scss b/styles/patterns/_inverted-corners.scss index b9b022b..7a64565 100644 --- a/styles/patterns/_inverted-corners.scss +++ b/styles/patterns/_inverted-corners.scss @@ -4,13 +4,13 @@ */ :root { - --inverted-corners-background: #52525B; + --inverted-corners-background: #52525b; --inverted-corners-size: 2rem; } .inverted-corners { background-color: var(--inverted-corners-background); - + /* Used to position the corner */ position: relative; @@ -49,5 +49,5 @@ justify-content: center; /* Misc */ - color: #FFF; -} \ No newline at end of file + color: #fff; +} diff --git a/styles/patterns/_layered-card.scss b/styles/patterns/_layered-card.scss index 4295d5a..04d7913 100644 --- a/styles/patterns/_layered-card.scss +++ b/styles/patterns/_layered-card.scss @@ -10,7 +10,7 @@ .layered-card::before { background: rgba(0, 0, 0, 0.3); content: ''; - + /* Position */ top: 0; left: 0; diff --git a/styles/patterns/_price-tag.scss b/styles/patterns/_price-tag.scss index f7be3ec..4972c76 100644 --- a/styles/patterns/_price-tag.scss +++ b/styles/patterns/_price-tag.scss @@ -10,7 +10,7 @@ .price-tag { background: var(--price-tag-background); - color: #FFF; + color: #fff; /* Center the price */ align-items: center; @@ -33,11 +33,9 @@ border-color: transparent var(--price-tag-background) transparent transparent; border-style: solid; - border-width: calc(var(--price-tag-height) / 2) - calc(var(--price-tag-height) / 2) - calc(var(--price-tag-height) / 2) - 0rem; - + border-width: calc(var(--price-tag-height) / 2) calc(var(--price-tag-height) / 2) calc(var(--price-tag-height) / 2) + 0rem; + /* Position */ left: 0px; position: absolute; @@ -49,10 +47,10 @@ .price-tag::after { content: ''; - /* Make it like a cirle */ - background: #FFF; + /* Make it like a cirle */ + background: #fff; border-radius: 9999rem; - + /* Position */ left: 0; position: absolute; diff --git a/styles/patterns/_three-dimensions-card.scss b/styles/patterns/_three-dimensions-card.scss index 41f9ab6..6fcd4a8 100644 --- a/styles/patterns/_three-dimensions-card.scss +++ b/styles/patterns/_three-dimensions-card.scss @@ -12,10 +12,10 @@ } /* The left side */ -.three-dimensions-card::before { +.three-dimensions-card::before { background: rgba(0, 0, 0, 0.3); content: ''; - + /* Position */ top: var(--three-dimensions-card-left-side-width); left: 0px; @@ -31,8 +31,8 @@ /* The bottom side */ .three-dimensions-card::after { background: rgba(0, 0, 0, 0.3); - content: ''; - + content: ''; + /* Position */ bottom: 0px; left: 0px; diff --git a/styles/patterns/_tree-diagram.scss b/styles/patterns/_tree-diagram.scss index 306134e..5c5656f 100644 --- a/styles/patterns/_tree-diagram.scss +++ b/styles/patterns/_tree-diagram.scss @@ -14,7 +14,7 @@ } .tree-diagram ul ul::before { - border-right: 1px solid rgba(0, 0, 0, .3); + border-right: 1px solid rgba(0, 0, 0, 0.3); content: ''; height: 1rem; position: absolute; @@ -29,13 +29,13 @@ /* Center the content */ align-items: center; - display: flex; + display: flex; flex-direction: column; } .tree-diagram li::before { - border-right: 1px solid rgba(0, 0, 0, .3); - border-top: 1px solid rgba(0, 0, 0, .3); + border-right: 1px solid rgba(0, 0, 0, 0.3); + border-top: 1px solid rgba(0, 0, 0, 0.3); content: ''; height: 1rem; @@ -47,7 +47,7 @@ } .tree-diagram li::after { - border-top: 1px solid rgba(0, 0, 0, .3); + border-top: 1px solid rgba(0, 0, 0, 0.3); content: ''; /* Position */ diff --git a/styles/patterns/_zigzag-timeline.scss b/styles/patterns/_zigzag-timeline.scss index 46cbfde..5e45f4f 100644 --- a/styles/patterns/_zigzag-timeline.scss +++ b/styles/patterns/_zigzag-timeline.scss @@ -8,7 +8,7 @@ position: relative; /* Border */ - border-bottom: 1px solid #71717A; + border-bottom: 1px solid #71717a; /* Take full width */ width: 100%; @@ -16,7 +16,7 @@ .zigzag-timeline__milestone { /* Absolute position */ - position: absolute; + position: absolute; top: 50%; /* Circle it */ @@ -25,24 +25,23 @@ width: 2rem; /* Misc */ - background: #71717A; + background: #71717a; } /* Styles for even items */ .zigzag-timeline__item:nth-child(2n) { - border-left: 1px solid #71717A; - + border-left: 1px solid #71717a; } .zigzag-timeline__item:nth-child(2n) .zigzag-timeline__milestone { left: 0; - transform: translate(-50%, -50%); + transform: translate(-50%, -50%); } /* Styles for odd items */ .zigzag-timeline__item:nth-child(2n + 1) { - border-right: 1px solid #71717A; + border-right: 1px solid #71717a; } .zigzag-timeline__item:nth-child(2n + 1) .zigzag-timeline__milestone { right: 0; transform: translate(50%, -50%); -} \ No newline at end of file +} diff --git a/tsconfig.json b/tsconfig.json index 041f562..5f93c3d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,32 +1,22 @@ { - "compilerOptions": { - "outDir": "./dist/", - "esModuleInterop": true, - "sourceMap": true, - "noImplicitAny": true, - "module": "esnext", - "moduleResolution": "node", - "target": "esnext", - "jsx": "preserve", - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], - "allowJs": true, - "skipLibCheck": true, - "strict": false, - "forceConsistentCasingInFileNames": true, - "noEmit": true, - "resolveJsonModule": true, - "isolatedModules": true - }, - "include": [ - "next-env.d.ts", - "**/*.ts", - "**/*.tsx" - ], - "exclude": [ - "node_modules" - ] + "compilerOptions": { + "outDir": "./dist/", + "esModuleInterop": true, + "sourceMap": true, + "noImplicitAny": true, + "module": "esnext", + "moduleResolution": "node", + "target": "esnext", + "jsx": "preserve", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "strict": false, + "forceConsistentCasingInFileNames": true, + "noEmit": true, + "resolveJsonModule": true, + "isolatedModules": true + }, + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "exclude": ["node_modules"] } diff --git a/tslint.json b/tslint.json index 2b35daa..7240ac9 100644 --- a/tslint.json +++ b/tslint.json @@ -8,4 +8,4 @@ "quotemark": ["single"] }, "rulesDirectory": [] -} \ No newline at end of file +} diff --git a/utils/randomFromArray.ts b/utils/randomFromArray.ts index c71f34f..2fcf84e 100644 --- a/utils/randomFromArray.ts +++ b/utils/randomFromArray.ts @@ -1,3 +1,3 @@ export function randomFromArray(array: T[]): T { return array[Math.floor(Math.random() * array.length)]; -}; +} diff --git a/utils/randomIterms.ts b/utils/randomIterms.ts index a17f775..b7e0c30 100644 --- a/utils/randomIterms.ts +++ b/utils/randomIterms.ts @@ -4,11 +4,9 @@ export function randomItems(arr: T[], count: number): T[] { const result = arr.concat().reduce( (p, _, __, arr) => { const [a, b] = p; - return (a < count) - ? [a + 1, b.concat(arr.splice(Math.random() * arr.length | 0, 1))] - : p; + return a < count ? [a + 1, b.concat(arr.splice((Math.random() * arr.length) | 0, 1))] : p; }, [0, []] as Tuple ); return (result as Tuple)[1]; -}; +}