• This repository has been archived on 14/Sep/2021
  • Stars
    star
    309
  • Rank 130,316 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 8 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Living style guide for SEEK, powered by React, webpack, CSS Modules and Less.

⚠️ NOTE: This project has been deprecated in favour of Braid Design System.


Build Status npm semantic-release Commitizen friendly Styled with Prettier

seek-style-guide

Living style guide for SEEK, powered by React, webpack, CSS Modules and Less.

If you're creating a new project from scratch, consider using sku, our officially supported front-end development toolkit. It's specially designed to get your project up and running as quickly as possible, while simplifying the process of keeping your development environment up to date.

If you'd instead like to work on a custom webpack project, you can use seek-style-guide-webpack to streamline the integration process.

Installation

$ npm install --save seek-style-guide react react-dom react-helmet

Optionally, if not making use of the React components, you can install seek-style-guide by itself:

$ npm install --save seek-style-guide

Upgrading

Consumers can stay up to date by following our release notes, which are published automatically whenever a new release is published to npm.

Setup

Wrap your app with the StyleGuideProvider component to use any of the style guide components. For example:

import React, { Component } from 'react';
import { StyleGuideProvider } from 'seek-style-guide/react';

export default class App extends Component {
  render() {
    const locale = 'AU';
    const title = '...';
    const meta = [{ name: 'description', content: '...' }];
    const link = [{ rel: 'canonical', href: 'https://www.seek.com.au/' }];

    return (
      <StyleGuideProvider locale={locale} title={title} meta={meta} link={link}>
        ...
      </StyleGuideProvider>
    );
  }
}

StyleGuideProvider's props are used to set the page head properties using Helmet.

High Level Components

As much as possible, you should aim to minimise the amount of custom CSS you need to write. This is achieved by leveraging our suite of high level components, which are demonstrated on our style guide documentation site.

Low Level Styling

For more advanced pages, if you need to drop down into Less, the style guide provides a set of mixins and variables to make it easier to stay on brand.

In any style sheet that depends on the style guide, first import the Less theme by reference.

@import (reference) '~seek-style-guide/theme';

Responsive Breakpoint

The style guide exposes one responsive breakpoint:

@responsive-breakpoint: 740px;

Content should otherwise be responsive within its container. The set of included components follow this model internally if you'd like to get a sense of what this looks like in practice.

Color Variables

As much as possible, colors should be directly imported from the style guide.

The following colors are provided:

// Brand colors
@sk-blue-darker;
@sk-blue-dark;
@sk-blue;
@sk-blue-light;
@sk-blue-lighter;
@sk-pink;
@sk-green;
@sk-green-light;
@sk-purple;
@sk-teal;
@sk-orange;
@sk-yellow;
@sk-yellow-light;

// Partner brand colors
@sk-business;
@sk-volunteer;
@sk-learning-light;
@sk-learning-medium;
@sk-learning-dark;

// Grays
@sk-black;
@sk-charcoal;
@sk-mid-gray-dark;
@sk-mid-gray-medium;
@sk-mid-gray;
@sk-mid-gray-light;
@sk-gray-light;
@sk-gray-lightest;
@sk-off-white;
@sk-white;

// Element colors
@sk-link;
@sk-link-visited;
@sk-focus;
@sk-footer;
@sk-background;
@sk-form-accent;
@sk-positive-light;
@sk-positive;
@sk-info-light;
@sk-info;
@sk-critical-light;
@sk-critical;
@sk-help-light;
@sk-help;

Z-Indexes

To ensure correct relative elements stacking order, z-index variables are provided:

@z-index-header-overlay;
@z-index-header;
@z-index-page-overlay;
@z-index-inline-overlay;
@z-index-negative;

Accessible Color Variants

The contrast ratio of certain foreground/background color combinations don't meet the AA accessibility standards that we aim for. As a result, a suite of accessible variants have been provided:

@sk-mid-gray-on-white;
@sk-pink-on-gray-light;
@sk-learning-dark-on-gray-light;
@sk-business-on-gray-light;
@sk-link-on-mid-gray-light;
@sk-mid-gray-dark-on-gray-light;

Please note that this list is not exhaustive, so contributions are encouraged. To validate color combinations, we recommend the use of the web-based tool Accessible Colors by @moroshko.

Grid Variables

In order to ensure elements correctly follow the grid, element sizing should always be controlled by the following variables:

@row-height;
@gutter-width;
@column-width;
@container-width;

When defining a document content container:

.element {
  max-width: @container-width;
}

When defining heights and vertical padding/margins:

.element {
  height: (@row-height * 3);
  padding-bottom: @row-height;
  margin-bottom: @row-height;
}

When defining widths and horizontal padding/margins:

.element {
  width: (@column-width * 3);
  padding-right: @gutter-width;
  margin-right: @column-width;
}

It's important to note that any additions to these values (e.g. borders) will need to be negated to maintain rhythm:

.element {
  @border-width: 1px;
  border-bottom: @border-width solid @sk-charcoal;
  padding-bottom: @row-height - @border-width;
}

Advanced Usage

Babel Plugin

Note: If you're using sku, this plugin is already enabled.

In order to help you optimise your bundle size, you can use babel-plugin-seek-style-guide.

$ npm install --save-dev babel-plugin-seek-style-guide

Then, add seek-style-guide to the plugins list in your Babel config. For example, in .babelrc:

{
  "plugins": ["seek-style-guide"]
}

Flow Type Checking

We've opted to include flow type checking in this project. If you're unfamiliar with static type checking you should start by reading React's overview.

This is completely opt-in and if you've decided not to use type checking in your project then there is nothing you need to do. It shouldn't impact your ability to include the style guide so long as you are using either sku or our webpack decorator.

Conversely, if you would like to opt-in to flow types you'll need to ensure that your .flowconfig includes a few exclusions and special options.

[ignore]
.*/node_modules/config-chain/.*
.*/node_modules/npmconf/.*

[include]

[libs]

[lints]

[options]
# This is required to prevent errors to less file imports
module.name_mapper.extension='less' -> '<PROJECT_ROOT>/no-declarations.js.flow'

# Good idea to ignore json too
module.name_mapper.extension='json' -> '<PROJECT_ROOT>/no-declarations.js.flow'

no-declarations.js.flow is just an empty file

Sketch asset generation

On every successful build (via npm test), asketch.json files (i.e. almost Sketch files) are generated by html-sketchapp containing document styles and symbols. These are provided via the following JSON files:

  • dist/asketch/document.asketch.json
  • dist/asketch/page.asketch.json

These can be manually imported into Sketch by downloading html-sketchapp and installing asketch2sketch.sketchplugin.

Once in Sketch, open the "Plugins" menu and select "From *Almost* Sketch to Sketch". Assuming you've run a full build of the style guide via npm test, you should now be able to select the asketch.json files in dist/asketch.

Contributing

Refer to CONTRIBUTING.md.

If you're planning to change the public API, please open a new issue and follow the provided RFC template in the GitHub issue template.

License

MIT.

More Repositories

1

vanilla-extract

Zero-runtime Stylesheets-in-TypeScript
TypeScript
5,738
star
2

playroom

Design with JSX, powered by your own component library.
TypeScript
4,321
star
3

braid-design-system

Themeable design system for the SEEK Group
TypeScript
1,465
star
4

capsize

Flipping how we define typography in CSS.
TypeScript
1,356
star
5

treat

🍬 Themeable, statically extracted CSS‑in‑JS with near‑zero runtime.
TypeScript
1,152
star
6

html-sketchapp-cli

Quickly generate Sketch libraries from HTML documents and living style guides, powered by html-sketchapp
JavaScript
633
star
7

sku

Front-end development toolkit
JavaScript
472
star
8

serverless-haskell

Deploying Haskell applications to AWS Lambda with Serverless
Haskell
213
star
9

css-modules-typescript-loader

Webpack loader to create TypeScript declarations for CSS Modules
JavaScript
193
star
10

vocab

Vocab is a strongly typed internationalization framework for React
TypeScript
122
star
11

csp-server

CSP (Content Security Policy) reports server which forwards reports to Elasticsearch.
JavaScript
56
star
12

docker-ecr-cache-buildkite-plugin

Zero config plugin for caching Docker images in Amazon ECR or Google Container Registry
Shell
51
star
13

skuba

🀿 SEEK development toolkit for backend applications and packages
TypeScript
48
star
14

aws-sm-buildkite-plugin

Buildkite plugin for working with AWS Secrets Manager
Shell
42
star
15

listo

Listo. Use questionnaires and checklists to make it easy to do the right thing, regarding the software you build.
TypeScript
26
star
16

github-merged-pr-buildkite-plugin

BuildKite plugin to work with GitHub PRs
Shell
25
star
17

crackle

A build tool for apps and packages, static and server-rendered sites
TypeScript
20
star
18

changesets-snapshot

A GitHub Action for publishing snapshot releases when using changesets
TypeScript
18
star
19

fsharp-workshop

Exercises for an F# workshop.
F#
15
star
20

lightgbm4j

A JVM interface 🌯 for LightGBM, written in Scala, for inference in production.
Scala
14
star
21

is-pwned

is-pwned β€”Β Utility to safely check the HaveIBeenPwned "Pwned Passwords" database in the browser.
TypeScript
12
star
22

docker-ecr-publish-buildkite-plugin

Build, tag, and push Docker images to Amazon ECR
Shell
11
star
23

seek-style-guide-webpack

Webpack decorators for integrating with the SEEK Style Guide.
JavaScript
11
star
24

react-scrollmonitor

React wrapper for scrollMonitor
JavaScript
11
star
25

gradle-aws-plugin

AWS Plugin for Gradle
Scala
10
star
26

evaporate

Evaporate is a convention-based, simple CloudFormation Stack deployment tool.
Haskell
9
star
27

browserslist-config-seek

Shareable Browserslist config for SEEK
JavaScript
9
star
28

seek.automation.phantom

A Pact based service simulator.
C#
9
star
29

toolbox

Standard build tools
Shell
8
star
30

aec

AWS EC2 CLI - easily work with ec2 instances via the cli 🐢
Python
8
star
31

create-ecr-buildkite-plugin

Create and manage an Amazon ECR repository
Shell
7
star
32

seek.automation.stub

A Pact based stubbing library for .NET.
C#
7
star
33

dynamotools

Tools to manage DynamoDB tables.
Go
7
star
34

snyk-buildkite-plugin

Buildkite plugin for running Snyk scans
Python
7
star
35

renovate-config-seek

Shareable Renovate config for SEEK
JavaScript
7
star
36

eslint-config-seek

Shareable ESLint configuration used by SEEK
JavaScript
7
star
37

private-npm-buildkite-plugin

A Buildkite plugin to simplify the use of an NPM token to install private modules
Shell
6
star
38

datadog-event-buildkite-plugin

BuildKite plugin to send a deployment event to datadog
Shell
5
star
39

seek-stackable

iOS framework for laying out nested views vertically and horizontally.
Swift
5
star
40

ensure-gitignore

Ensure the presence of patterns within a project's gitignore
JavaScript
5
star
41

aws-lambda-scala

Example of an AWS Lambda function written in Scala with deployment tools
Scala
4
star
42

https-proxy-server

HTTP proxy server in Node.js allowing modification of user responses.
JavaScript
4
star
43

style-guide-resources-for-sketch

A template containing SEEK UI components, for designers using Sketch.
4
star
44

ssm-buildkite-plugin

Secure Store Parameters for Buildkite
Shell
4
star
45

scoobie

🧢 Component library for SEEK documentation sites
TypeScript
4
star
46

wingman

πŸ›© Reference implementation of a SEEK-integrated recruitment system
TypeScript
4
star
47

koala

🐨 Koa add-ons for SEEK-standard tracing, logging and metrics
TypeScript
4
star
48

nodejs-consumer-pact-interceptor

A Node.js consumer Pact tool.
JavaScript
3
star
49

rynovate

🦏 dangerouslySetRenovatePreset
3
star
50

commitlint-config-seek

Shareable commitlint config for SEEK
JavaScript
3
star
51

kpt-functions

A library of Kpt functions for extending Kpt's functionality
Go
3
star
52

ad-posting-api-client

SEEK's Job Ad Posting API .NET client and sample consumer code.
C#
2
star
53

serverless-plugin-inspect

Serverless plugin - Get AWS stack info in JSON.
JavaScript
2
star
54

IdentityServer4.Contrib.DynamoDB

A persistence layer using DynamoDB for operational data for Identity Server 4
C#
2
star
55

datadog-custom-metrics

🐢 Common interface for sending Datadog custom metrics from Node.js runtime environments
TypeScript
1
star
56

text1

A NonEmpty version of Data.Text
Haskell
1
star
57

skuba-dive

🌊 Minimal runtime for skuba
TypeScript
1
star
58

action-project-manager

A github action which labels and adds isses and PRs to github projects
JavaScript
1
star
59

fake-hr

Node.js package of HR data sets for mocking and testing
TypeScript
1
star
60

logger

TypeScript
1
star
61

tslint-config-seek

TSLint configuration used by SEEK
JavaScript
1
star
62

babel-plugin-seek-style-guide

Optimise your bundle by automatically rewriting import statements from seek-style-guide
JavaScript
1
star
63

splunk-logger

Generates Splunk consumable logs in Node JS 4.3.2 AWS Lambda functions.
JavaScript
1
star
64

redux-batched-subscribe

FORK: https://github.com/tappleby/redux-batched-subscribe
JavaScript
1
star
65

spark-dist

Spark with hadoop-aws 3.1 for modern S3 access
Makefile
1
star