diff --git a/packages/core/.storybook/mayflowerTheme.js b/packages/core/.storybook/mayflowerTheme.js index eaee1b023c..dc8751dcbe 100644 --- a/packages/core/.storybook/mayflowerTheme.js +++ b/packages/core/.storybook/mayflowerTheme.js @@ -3,14 +3,14 @@ import logo from './mayflower-logo.png'; export default create({ base: 'light', - // colorPrimary: 'hotpink', + colorPrimary: '#388557', colorSecondary: '#14558F', // UI appBg: '#F2F2F2', - // appContentBg: 'silver', + appContentBg: '#FFFFFF', appBorderColor: '#DCDCDC', - appBorderRadius: 6, + appBorderRadius: 0, // Typography fontBase: '"Noto Sans VF", "Noto Sans", "Helvetica", "Arial", sans-serif', diff --git a/packages/core/.storybook/preview.js b/packages/core/.storybook/preview.js index dfb8c71b78..632ab7f8ab 100644 --- a/packages/core/.storybook/preview.js +++ b/packages/core/.storybook/preview.js @@ -1,3 +1,5 @@ +import mayflowerTheme from './mayflowerTheme'; + const storyKindOrder = [ 'Get Started', 'Design Principles', @@ -16,5 +18,8 @@ export const parameters = { previewTabs: { canvas: { hidden: true } }, - viewMode: 'docs' + viewMode: 'docs', + docs: { + theme: mayflowerTheme, + } } diff --git a/packages/core/stories/about/Usage.stories.mdx b/packages/core/stories/about/Usage.stories.mdx index c7319eaf04..129a0e72d0 100644 --- a/packages/core/stories/about/Usage.stories.mdx +++ b/packages/core/stories/about/Usage.stories.mdx @@ -3,9 +3,11 @@ import { Meta } from '@storybook/addon-docs/blocks'; import generateTitle from '../util/generateTitle'; const { STORYBOOK_CDN_PATH, STORYBOOK_CDN, STORYBOOK_PKG } = process.env; + # Install Mayflower + We encourage all Commonwealth web properties to implement the Mayflower Design System for a consistent look and feel. It’s important that constituents know they are on an official state government website, and the visual cues that come from using a cohesive design help convey that legitimacy. ## Mayflower assets @@ -21,15 +23,16 @@ To enable and ensure the branding and visual cohesion, Mayflower delivers the fo ├── icons └── logos ``` -### Download the package -NPM Package -This package is named @massds/mayflower-assets and is published on NPM. If you use Node.js, you can download the whole package simply by running the following command line: +### Download the NPM package + +The package @massds/mayflower-assets is published on NPM. If you use Node.js, you can install it by running: ``` npm install @massds/mayflower-assets ``` ### Link to the Mayflower CDN + Mayflower leverages the UNPKG CDN and allows you to load any file in the @massds/mayflower-assets package directly. We highly recommend that you link to the CDN at a specific version. That way, you never have to worry about your website get impacted by any Mayflower breaking updates, and you can upgrade to a new Mayflower version whenever your team is ready. To load any file from the @massds/mayflower-assets package using a URL like: @@ -103,13 +106,15 @@ For examples: ## Build with Mayflower -To import fonts and get started with basic Mayflower layout CSS, you need to import `scss/global.scss` (@use `scss/global.scss`) or link to the compiled `static/fonts/css/global.css` (a minified version is available as global.min.css). -To implement a Mayflower branding component in your website, navigate to the documentation of the component and copy and paste the html and CSS (and JS) snippets into your code to get started. You can also link to the CDN version of CSS and JS files for the component directly in the head of your HTML. + +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. ## Configure Your Theme + Mayflower style guide is derived from our research, experience, and expertise, and decision making in creating Mass.gov. We recognize that not all aspects of this branding guide will make sense for every organization, and that some organizations have their own distinct branding. We provide SCSS variables and partials for organizations to configure and compile their own Mayflower stylesheets, based on individual branding needs. You can configure all the variables declared in scss/00-base with a !default flag, such as _variables.scss _colors.scss _color-tokens.scss _breakpoints.scss _z-index.scss For example to theme the Mayflower header with your own primary color: + ``` @use "00-base/configure" with ( $assets-path: "~@massds/mayflower-assets/static”, @@ -119,6 +124,7 @@ For example to theme the Mayflower header with your own primary color: ``` If you use Node.js, you can install Sass using npm by running: + ```$ npm install -g sass``` And compile any sass files by running diff --git a/packages/core/stories/styles/index.scss b/packages/core/stories/styles/index.scss index 4cb7789266..cd73d99fe2 100644 --- a/packages/core/stories/styles/index.scss +++ b/packages/core/stories/styles/index.scss @@ -46,6 +46,11 @@ } } +.sb-block.borderless { + margin: 3rem 0 !important; + padding: 0 !important; + border: 0 !important; +} // Intro story .row.ma__row--three-up { @@ -85,3 +90,42 @@ ul.sg-colors { } } } + +// Typography story +.font-specimen { + font-size: 1.7rem !important; + line-height: 1.25 !important; + word-break: break-all; + font-weight: 300; + + &.large { + font-size: 2.5rem !important; + } + & strong { + font-weight: 400; + } +} + +p.font-specimen { + margin: 0 0 .5rem; +} + +p.lang-label { + font-weight: 450; + margin: 0; + + &.rtl { + direction: rtl; + } +} + +p.font-specimen, +p.lang-label { + padding: 0 1rem; +} + +.reset-vspace * { + line-height: 1.5; + margin-block-start: 0; + margin-block-end: 0; +} diff --git a/packages/core/stories/tokens/typography/Typography.stories.mdx b/packages/core/stories/tokens/typography/Typography.stories.mdx index 276519428c..39cf649b6c 100644 --- a/packages/core/stories/tokens/typography/Typography.stories.mdx +++ b/packages/core/stories/tokens/typography/Typography.stories.mdx @@ -1,7 +1,6 @@ import { Meta, Story, ArgsTable } from '@storybook/addon-docs/blocks'; import DecorativeLink from '@massds/mayflower-react/dist/DecorativeLink'; import Heading from '@massds/mayflower-react/dist/Heading'; -// import RichText from '@massds/mayflower-react/dist/RichText'; import { characters, letters, @@ -23,146 +22,224 @@ import generateTitle from '../../util/generateTitle'; }} /> -# Noto Sans -**The official typeface of Mayflower is Noto Sans.** -It’s carefully chosen for the following reasons: -- Accessible and easy to read -- To enable all Commonwealth agencies to design, produce and deliver online and offline content with consistent typography, without additional costs or legal barriers. -- To provide comprehensive language coverage for content internationalization. -- To support the guiding principles of the Mass.gov brand identities: modern, dignified, human, helpful +# Typography + +
*Latin 1 Block, shown in light weight (350)
+Noto Sans is used for all headings and body text. If your HTML is [semantic](https://developer.mozilla.org/en-US/docs/Glossary/Semantics) and uses tags that match the hierarchy of the content on a page, the Mayflower defaults will automatically style your headings with an appropriate amount of contrast.
+ { Object.keys(headings).map((key, keyIndex) => ( + (key === "Body text") ? + ({key}
) : + (Mayflower uses 5 custom weights of Noto Sans:
Lighter (250); Light, (350); Normal, (400); Bold, (550); and Bolder, (650).
Use the following classes to style text with those weights:
+{`.${className}`}
+
+
+ Armenian:
+Բարի գալուստ Մասաչուսեթս
-#### Gujarati -Chinese:
+欢迎来到马萨诸塞州
-#### Hebrew -Chinese:
+歡迎來到馬薩諸塞州
-#### Japanese -Russian:
+Добро пожаловать в Массачусетс
-#### Korean -Ukrainian:
+Ласкаво просимо до Массачусетсу
-#### Lao -Greek:
+Καλώς ήλθατε στη Μασαχουσέτη
-#### Malayalam -Gujarati:
+મેસેચ્યુસેટ્સમાં
-#### Telugu -Hindi:
+मैसाचुसेट्स में आपका स्वागत है
-#### Vietnamese -Japanese:
+マサチューセッツへようこそ
-{key}
) : - (Khmer:
+សូមស្វាគមន៍មកកាន់ម៉ាសាឈូសេត
+#### Hangul script -Mayflower uses the the following 5 font weight options of Noto Sans: + +Korean:
+매사추세츠에 오신 것을 환영합니다
-| Font weight | Specs | -| :--- | :--- | -| Lighter | 250 | -| Light | 350 | -| Normal | 400 | -| Bold | 550 | -| Bolder | 650 | +#### Lao script + +Lao:
+ຍິນດີຕ້ອນຮັບສູ່ Massachusetts
-{`.${className}`}
-
- English:
+Welcome to Massachusetts
+ +Filipino:
+Maligayang pagdating sa Massachusetts
+ +French:
+Bienvenue au Massachusetts
+ +German:
+Willkommen in Massachusetts
+ +Haitian Creole:
+Byenveni nan Massachusetts
+ +Arabic:
+Maligayang pagdating sa Massachusetts
+ +Italian:
+Benvenuto in Massachusetts
+ +Polish:
+Witamy w Massachusetts
+ +Portuguese:
+Bem vindo a Massachusetts
+ +Spanish:
+Bienvenido a massachusetts
+ +Vietnamese:
+Chào mừng đến với Massachusetts
+ +#### Malayalam script + + +Malayalam:
+മസാച്ചുസെറ്റ്സിലേക്ക് സ്വാഗതം
+ +#### Tamil script + +Tamil:
+மாசசூசெட்ஸுக்கு வருக
+ +#### Telugu script + +Telugu:
+మసాచుసెట్స్కు స్వాగతం
+ +#### Thai script + +Thai:
+ยินดีต้อนรับสู่แมสซาชูเซตส์
+ +### Right-to-Left + +--- + +#### Arabic script + +Arabic:
+مرحبا بكم في ماساتشوستس
+ +Persian:
+به ماساچوست خوش آمدید
+ +Urdu:
+میساچوسٹس میں آپ کا استقبال ہےد
+ +#### Hebrew script +Hebrew:
+ברוך הבא למסצ'וסט.ס
## License -Noto Sans is an open source font licensed under SIL Open Font License 1.1 (OFL) by the Google team. The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. For more details, refer to the [license](https://github.com/googlefonts/noto-fonts/blob/master/LICENSE). +Noto Sans is an open source font licensed under SIL Open Font License 1.1 (OFL) by the Google team. The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. For more details, refer to the [license](https://github.com/googlefonts/noto-fonts/blob/master/LICENSE).