Giter Club home page Giter Club logo

dv-ditto's Introduction

DV Ditto

Easy custom built component for your project. Build web application even faster with components on top of React and Tailwind CSS

Why DV Ditto?

DV Ditto is built to fill a specific use case for DV where we need a framework to build a design system quickly for each of our venture. It has been designed to be :

  • Versatile

    Instead of importing the components, ditto copies the actual code into your repository that allows you to make changes and itterate faster compared to traditional third party components.

  • Customisable

    Ditto focus on customisability enabled by Tailwindcss. It allows engineers to customise a components as easy as changing class names. And every component codes are available to you.

  • Workflow focus

    Ditto is developed together with the designers to make the workflow between designers and engineers a breeze. And we are commited that way.

Getting started

DV Ditto is a command line tools that helps you to bootstrap your project. So before running the CLI tool on your project, you need to setup DV Ditto CLI.

The CLI will duplicate the components available in dv-ditto repository into your newly created/existing project. It will also inject related dependency into your package.json

(Guide to create Ditto as a separate repository will be coming soon)

Setting up dv-ditto CLI

These steps will go thru the installation of dv-ditto CLI tool. For now, this tools only support project that is created using CRA typescript

  1. To setup this, first you need to clone this project into your computer.
git clone path-to-repository
  1. Install the project dependencies
npm install
  1. Install the project as a global cli tools for npm
npm install . -g
  1. Verify the installation by typing
which dv-ditto
  1. It should show the executable path of dv-ditto

Use it on the project

Follow these steps to create a create react app and to bootstrap DV Ditto in your project

  1. Create a new CRA project
    npx create-react-app my-app --template typescript
  2. Go into the newly created project folder
    cd my-app
  3. Run the dv-ditto cli to bootstrap the project
    dv-ditto
  4. Install all of the dependencies
    npm install
  5. Add tailwind and dv-ditto dependency in your css file into the bottom of the page. on cra project, this typically would be your src/App.css file
    /* ... */
    @tailwind base;
    @tailwind components;
    @tailwind utilities;
    
    /* Font that is used in Ditto */
    @import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap');
  6. To test the integration with the main app, lets make some changes into the main code. In cra this would be App.tsx
    import { Button } from './lib';
    
    ...
    <Button>Welcome Ditto</Button>
    ...
  7. Run the app, you should see a styled button appeared on the screen
    npm run start

Running Storybook

By default, you get a storybook when you use DV Ditto. This helps to quickly preview your changes in your components, test combinations of options, etc.

To test if the components are copied correctly, run storybook using this commands

npm run start:storybook

Customisation Guide

Customizing Color

The main colors that Ditto used which is primary, secondary and tertiary are configured within tailwind.config.js

  ...
  primary: {
    10: '#c2c2c2',
    20: '#a9a9a9',
    40: '#808080',
    60: '#696969',
    80: '#444444',
    100: '#000000',
  },
  ...

Changing these colors will automatically updates the related components that uses these color sets. It is advisable to change this color in the beginning of the project.

Customizing font

To customise font, update the list on tailwind.config.js. Refer to the tailwind docs for more here

  ...
  fontFamily: {
    sans: ['Lato', ...defaultTheme.fontFamily.sans],
  },

Then add the font dependency into the main css file. e.g: App.css for CRA

@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap');

Contributing

Trello board

Figma

If you need the Figma files for the components, contact SIN XDs to get access to the Figma file

dv-ditto's People

Contributors

bacali95 avatar indrasantosa avatar joeychrys avatar k2glyph avatar mouracamila avatar nesrinesghaier avatar rluders avatar tulup-conner avatar zoltanszogyenyi avatar

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.