From 59537efc7b8fda5c58f70fbfbb5ce152400ee1b1 Mon Sep 17 00:00:00 2001
From: Minghua Sun
+
## Build with Mayflower
-To import fonts and get started with basic Mayflower layout CSS, import `scss/global.scss` (`@use scss/global.scss`) or link to the compiled `static/fonts/css/global.css` (or the minified version, global.min.css). To use a Mayflower branding component on your site, go to the documentation of the component and copy and paste the html and link to the CDN version of CSS and JS files in the head of your HTML. You can also host the CSS and JS downloaded from mayflower assets package.
+To start building with Mayflower in HTML, start by importing the global styles and then incrementally add the styles and JS for each Mayflower component:
+
+- To import fonts and get started with basic Mayflower styles, link to the compiled `css/global.css` (or the minified version, `css/global.min.css`) from the @massds/mayflower-assets package or the assets CDN.
+
+- To include basic page layout styles from Mayflower, link to the compiled `css/layout.css` (or the minified version, `css/layout.min.css`) from the @massds/mayflower-assets package or the assets CDN.
+
+- To use a Mayflower branding component on your site, go to the documentation of the component and copy and paste the HTML code snippet and link to the CDN version of CSS and JS files in the head of your HTML. You can also host the CSS and JS downloaded from mayflower assets package.
+
+To kickstart a web page with Mayflower Header, Footer, basic layout and styles:
+
+
+
## Configure Your Theme
diff --git a/packages/core/stories/components/Header/Header.stories.js b/packages/core/stories/components/Header/Header.stories.js
index 6711d6bc67..01fcdc8ad0 100644
--- a/packages/core/stories/components/Header/Header.stories.js
+++ b/packages/core/stories/components/Header/Header.stories.js
@@ -302,7 +302,7 @@ const notesHeaderSlim = `
const notesHeader = `
// Link to CSS:
- // Link to JS:
+ // Link to JS:
`
export const headerExample = () => headerBasic;
diff --git a/packages/core/stories/components/Template/Template.stories.js b/packages/core/stories/components/Template/Template.stories.js
new file mode 100644
index 0000000000..ddd2282e93
--- /dev/null
+++ b/packages/core/stories/components/Template/Template.stories.js
@@ -0,0 +1,100 @@
+import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
+
+import generateTitle from '../../util/generateTitle';
+import * as headerStories from '../Header/Header.stories.js';
+import * as footerStories from '../Footer/Footer.stories.js';
+
+const { STORYBOOK_CDN_PATH } = process.env;
+
+import { attachHTML } from '../../util/renderCode';
+
+export const template = ({renderHeader, renderFooter, reversed}) => {
+ return(
+
+ ` +} /> + + +## Usage +To kick-start a page in HTML: +1. Copy the code above or jump to an example below and click on "Show code" to copy the HTML snippet from the example +4. Add the links to CSS and JS at the appropriate places + - **CSS**: Link to CSS inside the `
` + - **JS**: Link to JS before the closing body tag `` +5. Replace the `.ma__placeholder` divs with real content + + + +## Examples + +### Header and Footer (Slim) +A demo page with the Slim Header, Slim Footer, and a layout of a full-width block, and two-column block with a right-rail. + + + +### Header and Footer (With Full Navigation) +A demo page with the Full Nav Header, Full Nav Footer, and a layout of a full-width block, and two-column block with a left-rail. + + diff --git a/packages/core/stories/meta.json b/packages/core/stories/meta.json index ea6f9f23b8..bea5ae39b5 100644 --- a/packages/core/stories/meta.json +++ b/packages/core/stories/meta.json @@ -66,5 +66,9 @@ "Footer": { "group": "Brand Components", "title": "Footer" + }, + "Template": { + "group": "Brand Components", + "title": "Template" } } diff --git a/packages/core/stories/styles/index.scss b/packages/core/stories/styles/index.scss index 90e360fa07..80f1501fe6 100644 --- a/packages/core/stories/styles/index.scss +++ b/packages/core/stories/styles/index.scss @@ -39,6 +39,9 @@ @use '@massds/mayflower-assets/scss/02-molecules/footer-links'; @use '@massds/mayflower-assets/scss/02-molecules/social-links'; +@use '@massds/mayflower-assets/scss/00-base/layout'; +@use '@massds/mayflower-assets/scss/01-atoms/place-holder'; + // Global .sp { &--top { diff --git a/packages/core/stories/util/renderCode.js b/packages/core/stories/util/renderCode.js index 03cb365bc2..8aad025abd 100644 --- a/packages/core/stories/util/renderCode.js +++ b/packages/core/stories/util/renderCode.js @@ -20,7 +20,7 @@ export const renderReactMarkup = (component, notes) => { plugins: [parserHtml] }); // Replaces the path to the state seal with the latest assets CDN. - return prettyMarkup.replace(/static\/media\/stateseal?([a-z|\-]*)\.(.*)\.png/, `${STORYBOOK_CDN_PATH}/static/images/logo/stateseal$1.png`); + return prettyMarkup.replace(/static\/media\/stateseal?([a-z|\-]*)\.(.*)\.png/g, `${STORYBOOK_CDN_PATH}/static/images/logo/stateseal$1.png`); } // can't pass DocsContext from .mdx