Custom Builds

View Source

WARNING: When using manual builds of Kahi UI, you'll need to rebuild the distributables every time you upgrade Kahi UI.

If you're building a Web Application that's particularly sensitive to latency, page sizes, etc. It's recommended to create custom builds of the Framework's CSS distributables.

Downloading

First, you'll need to head over to Releases, download the source code .zip / .tar.gz archive that matches the version of Kahi UI you're developing against, and decompress the archive onto your filesystem.

Installation

Once you've got everything downloaded and decompressed, open a terminal in the source code directory and install Kahi UI's dependencies.

npm ci

Building

Now you can start building the CSS distributables via a NPM script.

npm run build:framework

Which should output in the package/ directory like so.

package/
│
└───kahi-ui.framework.css           // Main CSS rules and stylings
└───kahi-ui.framework.css.map       // Source map for the above file
└───kahi-ui.theme.default.css       // Themeing variables that define the look and feel
└───kahi-ui.theme.default.css.map   // Source map for the above file

Then just copy the files you require into your Web Application's codebase and import them.

Minifying

You can also build the minified versions of the CSS distributables with another NPM script.

npm run build:minify

Which would output to package/ without source maps like so.

package/
│
└───kahi-ui.framework.min.css       // Main CSS rules and stylings
└───kahi-ui.theme.default.min.css   // Themeing variables that define the look and feel

Filters

Each individual feature of Kahi UI that requires CSS can turned off, removing it from builds. And it's as simple as adding command line parameters. Just run either of the NPM scripts with filter parameters following this format: --disable-{SCOPE}-{FEATURE}.

For instance, if wanting to disable Grid and the responsitivity of Spacings (e.g. margin={["mobile:medium"]}), try the following.

USAGE: The double dashes (--) after build:framework / build:minify is required so NPM passes our command line parameters to the script.

npm run build:framework -- --disable-globals-intrinsics-responsitivity --disable-components-grid

Components

  • Disclosure

    • --disable-components-disclosure-accordionAccordion
    • --disable-components-disclosure-carouselCarousel
    • --disable-components-disclosure-tabTab
  • Display

    • --disable-components-display-badgeBadge
    • --disable-components-display-kbdKbd
    • --disable-components-display-listList
    • --disable-components-display-tableTable
  • Embedded

    • --disable-components-embedded-figureFigure
  • Feedback

    • --disable-components-feedback-dotDot
    • --disable-components-feedback-ellipsisEllipsis
    • --disable-components-feedback-progressProgress
  • Interactables

    • --disable-components-interactables-buttonButton
    • --disable-components-interactables-checkCheck
    • --disable-components-interactables-file-drop-inputFileDropInput
    • --disable-components-interactables-formForm
    • --disable-components-interactables-number-inputNumberInput
    • --disable-components-interactables-radioRadio
    • --disable-components-interactables-switchSwitch
    • --disable-components-interactables-text-inputTextInput
  • Layouts

    • --disable-components-layouts-centerCenter
    • --disable-components-layouts-containerContainer
    • --disable-components-layouts-dividerDivider
    • --disable-components-layouts-gridGrid
    • --disable-components-layouts-groupGroup
    • --disable-components-layouts-mosaicMosaic
    • --disable-components-layouts-positionPosition
    • --disable-components-layouts-scrollableScrollable
    • --disable-components-layouts-spacerSpacer
    • --disable-components-layouts-stackStack
  • Navigation

    • --disable-components-navigation-anchorAnchor
    • --disable-components-navigation-asideAside
    • --disable-components-navigation-breadcrumbBreadcrumb
    • --disable-components-navigation-menuMenu
    • --disable-components-navigation-omniOmni
  • Overlays

    • --disable-components-overlays-backdropBackdrop
    • --disable-components-overlays-clickableClickable
    • --disable-components-overlays-overlayOverlay
    • --disable-components-overlays-popoverPopover
  • Surfaces

    • --disable-components-surfaces-boxBox
    • --disable-components-surfaces-cardCard
    • --disable-components-surfaces-heroHero
    • --disable-components-surfaces-tileTile
  • Typography

    • --disable-components-typography-blockquoteBlockquote
    • --disable-components-typography-codeCode
    • --disable-components-typography-headingHeading
    • --disable-components-typography-textText
  • Utilities

    • --disable-components-utilities-animationAnimation
    • --disable-components-utilities-portalPortal
    • --disable-components-utilities-transitionTransition
  • Widgets

    • --disable-components-widgets-dataselectDataSelect

Globals

WARNING: Most non-Component specific properties are implemented as global CSS attributes to reduce redundancy. If you turn off the feature, it turns off for ALL Components.

  • --disable-globals-alignments<* alignment="{ALIGNMENT}" alignment_x="{ALIGNMENT}" alignment_y="{ALIGNMENT}">
  • --disable-globals-alignments-responsitivity<* alignment={["{VIEWPORT}:{ALIGNMENT}]} alignment_x={["{VIEWPORT}:{ALIGNMENT}]} alignment_y={["{VIEWPORT}:{ALIGNMENT}]}>
  • --disable-globals-elevations<* elevation="{ELEVATION}">
  • --disable-globals-elevations-responsitivity<* elevation={["{VIEWPORT}:{ELEVATION}"]}>
  • --disable-globals-fit<* fit="{FIT}">
  • --disable-globals-fit-responsitivity<* fit={["{VIEWPORT}:{FIT}"]}>
  • --disable-globals-grid<* points="{POINTS}" span="{SPAN}" span_x="{SPAN}" span_y="{SPAN}">
  • --disable-globals-grid-responsitivity<* points={["{VIEWPORT}:{POINTS}"]} span={["{VIEWPORT}:{SPAN}"]} span_x={["{VIEWPORT}:{SPAN}"]} span_y={["{VIEWPORT}:{SPAN}"]}>
  • --disable-globals-intrinsics<* height max_height min_height margin padding size max_size min_size width max_width min_width>
  • --disable-globals-intrinsics-responsitivity<* height max_height min_height margin padding size max_size min_size width max_width min_width>
  • --disable-globals-orientations<* orientation="{ORIENTATION}">
  • --disable-globals-orientations-responsitivity<* orientation={["{VIEWPORT}:{ORIENTATION}"]}>
  • --disable-globals-palettes<* palette="{PALETTE}">
  • --disable-globals-radius<* radius="{RADIUS}">
  • --disable-globals-radius-responsitivity<* radius={["{VIEWPORT}:{RADIUS}"]}>
  • --disable-globals-sizings<* sizing="{SIZING}">
  • --disable-globals-sizings-responsitivity<* sizing={["{VIEWPORT}:{SIZING}"]}>
  • --disable-globals-spacings<* spacing="{SPACING}" spacing_x="{SPACING}" spacing_y="{SPACING}">
  • --disable-globals-spacings-responsitivity<* spacing={["{VIEWPORT}:{SPACING}"]} spacing_x={["{VIEWPORT}:{SPACING}"]} spacing_y={["{VIEWPORT}:{SPACING}"]}>