You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Styled Components are all exported and can be imported using the syntax import * as SC from ./style. The SC.StyledComponent syntax will allow us to differentiate styled components from others. See an example in the repo here.
Contents
Link to Figma board
HackMD Style Guide markdown here
Design Approach Styled Components
The project will be styled using with a Styled Components first approach. Components will be designed in isolation where possible using Storybook.
Variables
All variables that will be reused throughout the project (colour, button heights) will be stored in the
styles/variables.js
file.To use any of the variables import the following syntax can be used:
import * as vars from '../styles/variables'
File Structure
Styled components file
style.js
will be kept alongside the jsx and story file the components directory.Styled Components are all exported and can be imported using the syntax
import * as SC from ./style
.The SC.StyledComponent
syntax will allow us to differentiate styled components from others. See an example in the repo here.Storybook
Read this quick start guide for React from Step 4. The key steps are:
component.stories.js
fileexport default
the title of the storynpm run storybook
the script will load all the files in thesrc/
directory with*stories.js
Example
Design Principles
Colours
Inspiration from the Radio Zaatari colour scheme, Jordanian flag and the desert.
Typography
Buttons
Button Sizing
We will use medium and low priority buttons on this project aiming for heights of 42 and 38 pixels respectively.
Guidance taken from Optimal Size and Spacing for Mobile Buttons.
Spacing
We will maintain a spacing of at least 36px for our buttons.
Vertical Padding
Vertical padding for low and medium priority buttons tbc.
![vertical button padding](https://i.imgur.com/hpVfB2z.png =500x)
Horizontal Padding
Horizontal padding will be 8px
![horizontal button padding](https://i.imgur.com/NJDabWS.png =500x)
Resources
The text was updated successfully, but these errors were encountered: