All Projects → sflpro → dresscode

sflpro / dresscode

Licence: other
A React Component library

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to dresscode

react
An implementation of GitHub's Primer Design System using React
Stars: ✭ 2,023 (+9095.45%)
Mutual labels:  component-library
GNUI
💅 Nordcloud's design system for SaaS products.
Stars: ✭ 21 (-4.55%)
Mutual labels:  component-library
chatty-form
A highly theme-able and customisable form in the shape of a chat based interface for React.
Stars: ✭ 27 (+22.73%)
Mutual labels:  component-library
kahi-ui
Straight-forward Svelte UI for the Web
Stars: ✭ 169 (+668.18%)
Mutual labels:  component-library
fyndiq-ui
Library of reusable web frontend components for Fyndiq
Stars: ✭ 39 (+77.27%)
Mutual labels:  component-library
plugin-toolkit-react
Adobe XD plugin UI components for React
Stars: ✭ 30 (+36.36%)
Mutual labels:  component-library
Different-UI
✨ A Vue.js 3 UI Library — a Toy
Stars: ✭ 62 (+181.82%)
Mutual labels:  component-library
kongponents
🦍 🖖🏻 Kong Vue Component Library
Stars: ✭ 81 (+268.18%)
Mutual labels:  component-library
react-vtkjs-viewport
VTK.js image viewport component in React
Stars: ✭ 112 (+409.09%)
Mutual labels:  component-library
tail-kit
React UI kit built using tailwindcss
Stars: ✭ 49 (+122.73%)
Mutual labels:  component-library
lerna-starter
Simple React UI Development environment boilerplate to develop, test and publish your React components.
Stars: ✭ 55 (+150%)
Mutual labels:  component-library
cargo-react
A Boilerplate for creating Component Libraries in React + Typescript + StoryBook + Styled Components
Stars: ✭ 13 (-40.91%)
Mutual labels:  component-library
pyrene
Open Systems Component Library
Stars: ✭ 17 (-22.73%)
Mutual labels:  component-library
dorai-ui
Accessible, unstyled, open-sourced, and fully functional react component library for building design systems
Stars: ✭ 34 (+54.55%)
Mutual labels:  component-library
ui-glassmorphism
📘 React component library on 'glassmorphism' UI/UX trend.
Stars: ✭ 20 (-9.09%)
Mutual labels:  component-library
ui-react
ui-react-docs.kibalabs.com/
Stars: ✭ 18 (-18.18%)
Mutual labels:  component-library
periqles
React form library for Relay and Apollo
Stars: ✭ 124 (+463.64%)
Mutual labels:  component-library
enterprise-wc
Enterprise-grade web component library for the Infor Design System
Stars: ✭ 14 (-36.36%)
Mutual labels:  component-library
neon
Neon is a modern VueJS design library built with Typescript and SASS
Stars: ✭ 19 (-13.64%)
Mutual labels:  component-library
DNZ.MvcComponents
A set of useful UI-Components (HtmlHelper) for ASP.NET Core MVC based-on Popular JavaScript Plugins (Experimental project).
Stars: ✭ 25 (+13.64%)
Mutual labels:  component-library

Build Status

DressCode - React component library

DressCode is SFL's own take on component libraries, implemented using React.

About DressCode

DressCode is an attempt to use the latest and the best CSS has to offer today and stay as close to HTML5 semantics and APIs as possible when designing React components.

Demo

All components have corresponding StoryBook files. To view and play around with available components you can run StoryBook locally (we are working on creating a hosted version):

# clone the repo
git clone [email protected]:sflpro/dresscode.git

# move inside the project directory
cd ./dresscode

# install dependencies
npm ci

# run storybook server
npm run storybook

Architecture

DressCode is a collection of raw JS and CSS files that are not bundled or transpiled (except JSX to ES5 transpilation). This means that the build system on the user's side should be configured respectively to make needed transpilations and conversions.

React and JS

The library is basically a collection of React components with heavy usage of React Hooks.

CSS

All configuration for styles is done via CSS custom properties. The library implies usage of postcss and postcss-preset-env to enable next-gen CSS features.

Usage

To use any of components, you need to first import the JS module:

import { Button } from '@sflpro/dresscode/lib/Button';

export default function HelloWorld() {
  return (
    <Button>Click me!</Button>
  );
}

The @sflpro/dresscode/lib/Button module will itself import @sflpro/dresscode/lib/Button/button.css for styling, which means you have to configure your bundler to support .css imports. It's also highly recommended to add CSS Modules to your build pipeline to avoid naming collisions.

Here is an example configuration for webpack:

{
  test: /\.(css)$/,
  use: [
    {
      loader: MiniCssExtractPlugin.loader,
    },
    {
      loader: 'css-loader',
      options: {
        importLoaders: 1,
        modules: true,
        localIdentName: '[name]__[local]___[hash:base64:5]',
      },
    },
    {
      loader: 'postcss-loader',
      options: {
        config: {
          path: `${__dirname}/postcss.config.js`,
        },
      },
    },
  ],
}

And here is an example of PostCSS config:

module.exports = {
  plugins: {
    'postcss-mixins': {
      mixinsFiles: [
        'node_modules/@sflpro/dresscode/lib/mixins/grid.css',
        'node_modules/@sflpro/dresscode/lib/mixins/typography.css',
        'node_modules/@sflpro/dresscode/lib/fonts.css',
        './static/assets/css/customMixins.css',
      ],
    },
    'postcss-preset-env': {
      importFrom: [
        'node_modules/@sflpro/dresscode/lib/defaults.css',
        './static/assets/css/colorScheme.css',
        './static/assets/css/defaults.css',
        './static/assets/css/customMedia.css',
        './static/assets/css/main.css',
      ],
      features: {
        'nesting-rules': true,
        'custom-properties': {
          preserve: false,
        },
        'custom-media-queries': true,
      },
    },
  },
};

defaults.css, colorScheme.css and defaults.css provide CSS custom property globals, via which theme configuration is done.

:root {
  --primary-color: var(--violet-300);
  --primary-color-light: var(--violet-100);
  --primary-color-dark: var(--violet-400);

  --success-color: var(--green-300);
  --warning-color: var(--yellow-300);
  --error-color: var(--red-300);
  --error-color-dark: var(--red-400);

  --text-default-color: var(--neutral-900);

  ...
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].