Getting Started
Wedgekit is meant as a starter guide and kit to quickly begin a DMSi project or help apply consistency in your project.
Methodology
Wedgekit follows BEM methodology for naming classnames and the Atomic Design methodology for sorting and organizing components.
BEM (Block, Element, Modifier)
The Block, Element, Modifier methodology (commonly referred to as BEM) is a popular naming convention for classes in HTML and CSS. Developed by the team at Yandex, its goal is to help developers better understand the relationship between the HTML and CSS in a given project.
Good documentation on this
Atomic design
Atomic design is way to structure and organize your stylesheets in a way that makes sense to you and your team. Read this - http://atomicdesign.bradfrost.com/chapter-2/ to learn more about the methodology.
Importing WedgeKit
You may either import wedgekit.scss or the individual components. NOTE the order of this is very important.
@import "settings/settings";
@import "mixins/mixins";
@import "tools/tools";
@import "atoms/atoms";
@import "molecules/molecules";
@import "organisms/organisms";
@import "utilities/utilities";
Adding new SCSS components
This is a working style guide. Add new components and documentation as needed for DMSi project. Make sure to follow the atomic design approach to decide where to place the new component.
Let's say you want to add a new organism. Simply add _.myNew.organisms.scss to the /scss/organisms directory. To import your new component, add @import "myNew.organisms"; to /scss/organisms/_organisms.scss file.
Adding new JS components
To add a new JS component, use the command:
yarn run add-component
Enter the name of the component, and indicate whether it can be created as a stateless function. For more information about stateless functions, see here.
Library Use
yarn add @dmsi/wedgekit
OR
npm install --save @dmsi/wedgekit
######Importing
import { Alerts } from '@dmsi/wedgekit'
######Webpack
module.exports = {
entry: [
'!!style-loader!css-loader!../node_modules/@dmsi/wedgekit/wedgekit.css'
]
};
TODO
- Reminder: add DMSi rules for when/how to use a component.
- Document settigns, tools, mixins and utilities.