Loading...
Loading...
Complete reference for all SGDS utility classes with the sgds: prefix. Use when users ask about setup, background-color, text-color, border-color, border-width, border-radius, typography, spacing, grid, dimension, opacity, color-semantics, or any sgds: Tailwind utility class. Also covers Tailwind v4 imports, theme switching, and framework integration for utilities.
npx skill4agent add govtechsg/sgds-web-component sgds-utilitiessgds:sgds:<!-- ✅ Correct -->
<div class="sgds:p-4 sgds:bg-primary-default sgds:text-white">Content</div>
<!-- ❌ Wrong - missing prefix -->
<div class="p-4 bg-primary-default text-white">Content</div>utility.css@theme@import "tailwindcss/theme.css"/* e.g. globals.css, index.css, main.css */
@import "@govtechsg/sgds-web-component/css/utility.css";sgds:/* e.g. globals.css, index.css, main.css */
@import "@govtechsg/sgds-web-component/themes/day.css";
@import "@govtechsg/sgds-web-component/themes/night.css";sgds:bg-surface-defaultsgds:bg-primary-defaultsgds:text-defaultsgds:text-primary-defaultsgds:border-defaultsgds:border-primary-defaultsgds:p-4sgds:m-2sgds:gap-6sgds:text-xlsgds:font-boldsgds:rounded-lgsgds:opacity-50sgds:flexsgds:grid<button id="theme-toggle">Toggle Theme</button>
<script>
const toggleButton = document.getElementById("theme-toggle");
toggleButton.addEventListener("click", () => {
document.documentElement.classList.toggle("sgds-theme-night");
});
</script><!DOCTYPE html>
<html>
<head>
<!-- processed by your Tailwind build -->
</head>
<body class="sgds:bg-default sgds:p-6">
<div class="sgds:bg-surface-raised sgds:p-4 sgds:rounded-lg">
<h1 class="sgds:text-heading-default sgds:text-2-xl sgds:font-bold sgds:mb-4">Setup Test</h1>
<p class="sgds:text-body-default sgds:mb-4">If this text is styled correctly, your setup is complete.</p>
<button
class="sgds:bg-primary-default sgds:text-white sgds:px-4 sgds:py-2 sgds:rounded"
onclick="document.documentElement.classList.toggle('sgds-theme-night')"
>
Toggle Theme
</button>
</div>
</body>
</html>@importglobals.cssmain.cssindex.css@import "@govtechsg/sgds-web-component/css/utility.css";
/* Optional: theme-aware color tokens */
@import "@govtechsg/sgds-web-component/themes/day.css";
@import "@govtechsg/sgds-web-component/themes/night.css";| Category | Utility | Theme files required | Reference |
|---|---|---|---|
| Layout | Grid system ( | No | → reference/grid.md |
| Layout | Container dimensions ( | No | → reference/dimension.md |
| Spacing | Margin, padding, gap ( | No | → reference/spacing.md |
| Color | Color token suffix semantics (default, emphasis, muted, fixed, etc.) | — | → reference/color-semantics.md |
| Color | Background colors ( | Yes | → reference/background-color.md |
| Color | Text colors ( | Yes | → reference/text-color.md |
| Color | Border colors ( | Yes | → reference/border-color.md |
| Border | Border width and sides ( | No | → reference/border-width.md |
| Border | Border radius ( | No | → reference/border-radius.md |
| Typography | Font size, weight, line height, letter spacing, font family | No | → reference/typography.md |
| Visual | Opacity ( | No | → reference/opacity.md |
| Visual | Elevation / box shadows ( | No | → reference/elevation.md |
| Patterns | Cross-category component patterns (card, alert, form, modal) | — | → reference/overview-patterns.md |
day.cssnight.css.sgds-container.sgds-grid.sgds-col-*sgds:grid-cols-*reference/grid.mdsgds:gap-layout-*sgds:p-component-*sgds:p-4sgds:gap-6sgds:text-display-*sgds:text-heading-*sgds:text-body-*defaultemphasismutedsurfacefixed-lightfixed-darkinversereference/color-semantics.mdstylesgds:stylesgds:max-w-*sgds:max-w-2xlsgds:max-w-lgsgds:max-w-smsgds:max-w-container-*sgds:w-containerreference/dimension.md