Giter Club home page Giter Club logo

nr-theme's Introduction

Issues Pull Requests MIT License Lifecycle

NR-Theme

Description

This is a common repository for maintaining the FDS (Forest Digital Service) design system code. The design system is built on top of the Carbon Design System within Figma. Feel free to check our Figma FDS Design System.

This repository provides the custom design tokens and custom stylesheets for Carbon UI libary and Primevue UI library to support the FDS Design System. A shared landing page styling can be found here.

Installation and Usage

Prerequisite

Your project needs to have Sass configured to load .scss files

Installation

  • NPM
    • use npm i @bcgov-nr/nr-theme
  • Yarn
    • use yarn add @bcgov-nr/nr-theme

Usage (React)

  • Create a custom.scss file in ./src
  • Add import './custom.scss'; to your App.tsx file
  • Configure your custom.scss file to your taste with this example
  • Add a global css prefix bx to your project
    • in ./src/index.tsx:
      • import { ClassPrefix } from '@carbon/react';
    • wrap your <App /> with ClassPrefix:
      • <ClassPrefix prefix="bx">
            <App />
        </ClassPrefix>

Usage (Vue3)

For vue3 application, due to the restriction of the Carbon UI library, we will use PrimeVue to integrate with this common theme repo.

Configuration:

  • Follow the installation guide from PrimeVue official documentation to install PrimeVue

    npm install primevue primeicons
    
  • Add the following the main.ts file

    import { createApp } from 'vue';
    import PrimeVue from 'primevue/config';
    
    // use bootstrap4 as default style
    import 'primevue/resources/themes/bootstrap4-light-blue/theme.css';
    import 'primevue/resources/primevue.min.css';
    import 'primeicons/primeicons.css';
    
    // import the component override style sheet for primevue
    import '@bcgov-nr/nr-theme/style-sheets/primevue-components-overrides.scss';
    
    const app = createApp(App);
    app.use(PrimeVue);
    

    Install the SASS loader

    npm install -D sass-loader sass
    

Usage (Application Landing Page)

The landing page stylesheet can apply to all applications regardless the UI libraries. Apply the custom class name to your landing page elements, and import the landing page stylesheet.

@import '@bcgov-nr/nr-theme/style-sheets/landing-page-components-overrides.scss';

landing page image

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.