Graphwise Styleguide is a comprehensive set of design and coding standards for building consistent, maintainable, and scalable user interfaces across Graphwise projects. It provides a way to generate a styleguide stylesheet for different applications based on styleguide tokens file prepared by UX designer. This ensures a unified look and feel across all Graphwise products.
This module serves as the central styleguide for all Graphwise frontend projects. It includes:
- Design tokens for colors, typography, spacing, and more in json format.
- Utility function to generate CSS/SCSS stylesheets from the tokens.
- Documentation and usage examples
- Consistent Design Tokens: Colors, fonts, spacing, and breakpoints.
- Stylesheet Generation: Easily generate CSS/SCSS variables from design tokens.
- Documentation & Usage Examples: Guidance for integrating tokens and stylesheets.
Install via npm:
npm install graphwise-styleguideTokens file is big and hard to read in raw json format. To make it easier to browse and understand the tokens, you can run the following command
npm run generate-tokens-htmlThis will generate a tokens-browser.html file in the root directory of the repository. Open this file in your browser
to view the tokens in a more user-friendly format.
This workflow describes how to update and integrate design tokens and styles from Figma into the styleguide module and the application.
- A UX expert updates the styleguide and design tokens in Figma.
- A UX expert publishes the updated tokens to this repository in the
gw-themebranch. - Each commit must be accompanied by description what is the change in the design included in the coomit.
A UI developer:
- updates its local
gw-themebranch from the remote git repository - executes the build script
npm run buildto generate theme stylesheets with variables based on the tokens - links this npm module with the application where the design system is applied by executing
npm linkin this module andnpm link path/to/this/modulein the application's module that depend on this one. - Build and run the application to verify that all the changes are correct.
A UI developer:
- creates a branch from the
gw-themebranch - increases the package version following semantic versioning
- creates a merge request against
masterbranch - the merge request is reviewed and merged
A UI developer:
- generates the
dist/variables-dark.cssanddist/variables-light.cssstylesheets by runningnpm run buildin themasterbranch - publishes a new version of the styleguide package to NPM by executing
npm publish(requires a login in NPM)
- A UI developer installs the new styleguide version in the respective Graphwise application by updating its
package.json.
The generated stylesheets are large and may contain variables unused in the particular application. To optimize the
styleguide in case for the GraphDB Workbench application, the UI developer runs npm run build in the
packages/styleguide module. This runs a custom script that purges unused variables from the generated stylesheets
based on the actual usage in the application stylesheets. The optimized stylesheets are then are exposed for loading in
the application.
- Always follow semantic versioning when publishing updates.
- Ensure that unused variables are purged during the build process for optimal performance.
- Coordinate closely between UX and UI teams for smooth updates.
This project is licensed under the Apache License. See the LICENSE file for details.