Stitches Theme

Font Sizes

The font sizes defined in the stitches theme.

1 (12px): The quick brown fox2 (14px): The quick brown fox3 (16px): The quick brown fox4 (18px): The quick brown fox5 (21px): The quick brown fox6 (30px): The quick brown fox7 (37px): The quick brown fox8 (40px): The quick brown fox9 (44px): The quick brown fox10 (64px): The quick brown fox

Space

This is the unit that is used per default for margins, padding and gaps.

$1(5px)
$2(10px)
$3(15px)
$4(20px)
$5(25px)
$6(30px)
$7(40px)
$8(60px)
$9(80px)
$10(100px)

Size

This is the unit that is used per default for height and width.

$1(5px)
$2(10px)
$3(15px)
$4(20px)
$5(25px)
$6(35px)
$7(45px)
$8(65px)
$9(80px)

Colors

The color palette used in the theme.

$primary#3E54CF
$hiContrast#333
$loContrastwhite
$grayLighter#F6F6F6
$grayLight#E8E8E8
$grayMediumhsl(206 22% 7% / 35%)
$grayDark#737373
$grayBlueDark#524F64
$blueDark#222431
$faintBlackOverlayrgba(0, 0, 0, 0.02745)
$mediumBlackOverlayrgba(0, 0, 0, 0.267)
$dropdownBackgroundlinear-gradient(to left, #F8F8F8 50%, white 50%);

Base Components

Since we want a consistent feel across the website, we've tried to set up a convention for adding content sections to any page. A simple page section should start with the following structure:
<Section>
  <Container>
    <Text> </Text>
  </Container>
</Section>

The Section component facilitates spacing and vertical padding, Container holds the content within an appropriate width and horizontal padding.
Adding pieces of text should occur through the Text component.Text aims to implement a universal convention for adding text content with ideally no or minimal custom styling needed.

Section

Custom section component, that facilitates spacing and vertical padding for consistency in layout.

This is a preview of the section component.

This is a preview of the section component.

Container

Custom container component, that facilitates spacing and horizontal padding for consistency in layout.

container

Text

Custom text component, that aims to implement a universal convention for adding text content with ideally no or minimal custom styling needed.

Text can be styled through individual variants for size, line height, weight, etc (which should ideally be avoided where possible), or through the type variant that implements comprehensive looks for pieces of content like headings, paragraphs, etc.

Line height

Tight

Primary

Loose

Color

Primary

Black

White

Gray

DarkBlue

DarkGray

Font Weight

Normal

Medium

SemiBold

Bold

Bolder

Font Size

Font sizes are based on the theme's font sizes, which are set in the stitches.config.ts file and are used as tokens throughout the project. The font size can be set through the fontSize prop, which accepts a number from 0 to 9.
<Text fontSize="4">Lorem ipsum dolor sit amet.</Text>

Type

By default Text is a span tag, but any valid HTML tag can be passed via the as prop. The ability to pass any HTML tag through as and a separate look through the type prop creates a nice convention where an element can be styled independently from its HTML tag. This is useful as identical semantic structures may require different looks depending on their purpose.You can add a heading like this:
<Text as="h1" type="h2">
  Lorem ipsum
</Text>
Notice how the as and type props can be used in different combinations without having styles derive from the HTML tag itself.Or a paragraph like this:
<Text as="p">Lorem ipsum dolor sit amet.</Text>

h1Larger:

The quick brown fox jumps over the lazy dog

h1:

The quick brown fox jumps over the lazy dog

h2:

The quick brown fox jumps over the lazy dog

Flex

The Flex component can be used to position content in a more flexible way. It has variants like direction, align and justify that can be used to position content for convenience.

It can be used like so :
<Flex direction="column" align="center" justify="center" gap="1" wrap="wrap"> 
<Text> </Text>      
</Flex>
The gap prop can be used to add space between the children of the Flex component. The values 1 through 9 correspond to the space values in the theme.

I am a Flex container

with align center and justify center

and gap of 3

Grid

Grid custom component uses the properties of grid display as variants to adjust the layout of the children in a more structured way.

It can be used like so :
<Grid columns="3" flow="row" align="center" justify="center" gap="1">
<Text> </Text>
<Text> </Text>   
<Text> </Text>             
</Grid>
The columns prop can be used to specify the number of columns in the grid. The flow prop can be used to specify the direction of the grid. The align and justify props can be used to position the children of the grid. The gap prop can be used to add space between the children of the grid. Gap can also be specified as gapX for horizontal gap and gapY for vertical gap. The values 1 through 9 correspond to the space values in the theme.

A Grid container with 2 columns, gapX of 3 and gapY of 4 and padding of 3

Button

A custom button with predefined styled variants that can be used across the site

Variant

Size

Width

Default is 100% initial and 172 px after bp2(568 px).

Ghost