Giter Site home page Giter Site logo

sparkdesignsystem / spark-design-system Goto Github PK

View Code? Open in Web Editor NEW
106.0 11.0 76.0 67.82 MB

Spark Design System

Home Page: https://sparkdesignsystem.com

License: MIT License

JavaScript 52.15% HTML 0.09% TypeScript 38.24% SCSS 7.51% Swift 2.01%
spark design-system design-patterns hacktoberfest

spark-design-system's Introduction

Build Status

Spark Design System

Welcome to the Spark Design System, a product of Rocket Mortgage.

Spark Design System is where we collect our best solutions for how to design and build unified digital experiences for the Rocket brands.

  • Spark contains the basic patterns and components that make up the visual and interaction design of the Rocket Mortgage family of Fintech products. If your application is expected to look and behave like a Rocket Mortgage application, this package is the starting point. When the Spark Sass and JS setup files are imported into an application you will receive code for all of Spark.

Getting Started

Spark assumes your project is using Sass for styling and also that your project has a JavaScript build step that will transpile ES6+ and polyfill appropriately for browser support.

Spark

  • Install the npm package.

    npm install --save-dev @sparkdesignsystem/spark

  • Import the Sass setup file in your Sass build.

    @import "node_modules/@sparkdesignsystem/spark-styles/spark.scss";

    This will bring all Spark Sass patterns into your build. The Spark classes are namespaced so they don't affect any existing CSS.

  • Import the JS setup file in your JS build.

    import spark from "node_modules/@sparkdesignsystem/spark/spark";

    This will bring all Spark JS into your build.

Contribution Guide

Code Organization

Spark is managed as a monorepo. All of the Spark source code lives in a single repo, but is released as separate packages.

This repo consists of the design system packages, wrapped in an instance of Gatsby. Spark uses Gatsby for our main documentation site and Storybook for our component previews and developer documentation.

In the root there are three directories, react, angular and html. These house the files that are published to npm.

Dev Environment

If you want to run a copy of Gatsby locally:

  1. Navigate to the root directory of the project.
  2. Run npm install.
  3. Run npm start.
  4. Open your browser to http://localhost:8000/.

If you want to run a copy of Gatsby and Storybook locally:

  1. Navigate to the root directory of the project.
  2. Run npm run installall.
  3. Run npm start to start Gatsby then open your browser to http://localhost:8000/.
  4. Run (cd react/ ; npm run storybook) to start Storybook for React.
  5. Run (cd angular/ ; npm run storybook) to start Storybook for Angular.
  6. Run (cd html/ ; npm run storybook) to start Storybook for HTML.

Unit Tests

Spark uses the Jest test framework for unit tests. To run unit tests in Spark:

  1. Navigate to the framework directory of your choice from the root cd react, cd angular, or cd html.
  2. Run npm install if you have not already.
  3. Run npm test.
  4. See test output in terminal to determine number of passing or failed tests.

Code Style Standards

Spark follows specific coding styles for HTML, CSS and JavaScript to ensure maintainability and scalability.

HTML

  • Two spaces for indentation.
  • For better code readability the attributes of elements should each be on their own line when the number of attributes makes that element exceed a line length of 80 characters.

CSS

  • Two spaces for indentation.
  • CSS is written in Sass and preprocessed into CSS.
  • Class Naming Conventions can be found here.
  • Stylelint is used to lint Sass files and all of Spark Sass coding conventions can be found in the Stylelint configuration file .

JS

  • Two spaces for indentation.
  • Spark JS will use new features from ESNext and assumes applications using Spark have a JavaScript compiler setup.
  • Spark uses ESLint for JS linting.
  • ESLint is setup to use the Airbnb JavaScript Style Guide and Spark JS coding conventions come from there.
  • Data attributes on DOM elements is the chosen method for DOM selection.

React and Angular

  • For additionalClasses properties use the naming convention elementAdditionalClasses for other elements that we offer additional classes support on besides the main element.

Change Workflow

Coming Soon

Credit

Gatsby StorybookJS

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.