@idds/styles
v1.4.3
Published
Shared CSS styles and colors for INA Digital Design System
Readme
@idds/styles
Shared CSS styles and colors for INA Digital Design System.
This package contains all the CSS files used by both @idds/react and @idds/vue packages. All styles are optimized and bundled using PostCSS (autoprefixer, cssnano, postcss-import) and published from the dist/ folder.
Installation
npm install @idds/stylesUsage
Import complete bundle (Recommended)
Import the main entry point which includes all components, base styles, colors, and reset:
/* Development */
@import '@idds/styles';
/* Or use the explicit path */
@import '@idds/styles/index';
/* Production (minified) */
@import '@idds/styles/index.min';This will import:
- All component styles (Accordion, Button, Modal, Table, etc.)
- Base styles (colors, reset CSS)
- All color tokens and brand themes
Import base styles only
If you only need base styles (colors and reset) without components:
/* Development */
@import '@idds/styles/base';
/* Production (minified) */
@import '@idds/styles/base.min';This will import:
- All color tokens and brand themes
- CSS reset styles
Note: Individual component CSS files are no longer available as separate imports. All component styles are bundled into
index.cssfor optimal performance. If you're using@idds/reactor@idds/vue, the components already include the necessary styles via the main bundle.
Using CDN
You can use @idds/styles directly via CDN without installing it as a package. This is useful for quick prototypes, static HTML pages, or when you don't want to set up a build process.
Complete Bundle (Recommended)
Include the complete bundle which contains all components, base styles, colors, and reset:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My App</title>
<!-- INA Digital Design System Styles -->
<link
rel="stylesheet"
href="https://unpkg.com/@idds/styles@latest/dist/index.min.css"
/>
<!-- Or use jsDelivr -->
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@idds/styles@latest/dist/index.min.css"
/>
</head>
<body>
<!-- Your HTML content using INA Digital Design System classes -->
<div class="ina-button ina-button--primary">Button</div>
</body>
</html>Base Styles Only
If you only need base styles (colors and reset) without components:
<head>
<!-- Base styles only (colors + reset) -->
<link
rel="stylesheet"
href="https://unpkg.com/@idds/styles@latest/dist/base.min.css"
/>
</head>Using Specific Version
For production, it's recommended to pin to a specific version instead of @latest:
<!-- Using unpkg -->
<link
rel="stylesheet"
href="https://unpkg.com/@idds/[email protected]/dist/index.min.css"
/>
<!-- Using jsDelivr -->
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@idds/[email protected]/dist/index.min.css"
/>Available CDN Providers
- unpkg:
https://unpkg.com/@idds/styles@[version]/dist/[file] - jsDelivr:
https://cdn.jsdelivr.net/npm/@idds/styles@[version]/dist/[file]
Available files:
index.css/index.min.css- Complete bundle (all components + base)base.css/base.min.css- Base styles only (colors + reset)tailwind/css/[theme].css/tailwind/css/[theme].min.css- Tailwind CSS v4 themes
Example CDN URLs:
<!-- Complete bundle (minified) -->
<link
href="https://unpkg.com/@idds/[email protected]/dist/index.min.css"
rel="stylesheet"
/>
<!-- Base styles only (minified) -->
<link
href="https://unpkg.com/@idds/[email protected]/dist/base.min.css"
rel="stylesheet"
/>
<!-- Tailwind theme (minified) -->
<link
href="https://unpkg.com/@idds/[email protected]/dist/tailwind/css/idds.min.css"
rel="stylesheet"
/>
<link
href="https://unpkg.com/@idds/[email protected]/dist/tailwind/css/panrb.min.css"
rel="stylesheet"
/>Reference: Similar to how Vuetify provides CDN usage,
@idds/stylesbundles all components and styles into a single CSS file for easy CDN consumption.
Structure
The package is published from the dist/ folder with the following structure:
@idds/styles/
├── index.css # Complete bundle (all components + base)
├── index.min.css # Minified complete bundle
├── base.css # Base styles only (colors + reset)
├── base.min.css # Minified base styles
└── tailwind/
├── css/ # Tailwind CSS v4 theme files
│ ├── idds.css # Default theme
│ ├── idds.min.css # Minified
│ ├── panrb.css # Brand themes
│ └── ... # (with .min.css versions)
└── ts/ # Tailwind CSS v3 TypeScript tokens
├── default.ts
├── idds.ts
├── panrb.ts
└── ... # Brand-specific tokensNote: The
colors/,components/, andreset/folders are not published to npm. They are bundled intobase.cssandindex.cssduring the build process for optimal performance.
Available Components
This package includes CSS for all INA Digital Design System components:
- Accordion, Alert, Avatar, Badge, Button, Card, Checkbox, Chip
- DatePicker, Dropdown, FileUpload, Modal, Pagination, Stepper
- Table, TextField, TextArea, Toast, Tooltip, and more...
Tailwind CSS Integration
This package provides Tailwind CSS utilities for both Tailwind v3 and v4.
Tailwind CSS v3
For Tailwind v3, use the TypeScript token files:
// tailwind.config.js
import iddsTokens from '@idds/styles/tailwind/ts/idds';
import panRbTokens from '@idds/styles/tailwind/ts/panrb'; // Optional: brand theme
export default {
theme: {
extend: {
colors: {
...iddsTokens,
...panRbTokens, // Optional: extend with brand colors
},
},
},
};Then you can use classes like:
text-neutral-500bg-blue-500text-guide-500(which uses--ina-blue-500=#0968f6)
Available brand tokens:
@idds/styles/tailwind/ts/default- Default tokens@idds/styles/tailwind/ts/idds- IDDS tokens@idds/styles/tailwind/ts/inagov- INAGov brand@idds/styles/tailwind/ts/inaku- INAKu brand@idds/styles/tailwind/ts/inapas- INAPas brand@idds/styles/tailwind/ts/bgn- BGN brand@idds/styles/tailwind/ts/bkn- BKN brand@idds/styles/tailwind/ts/lan- LAN brand@idds/styles/tailwind/ts/panrb- panrb brand
Tailwind CSS v4
For Tailwind v4, use the CSS files with @theme syntax:
/* your main CSS file */
@import '@idds/styles/tailwind/css/idds.css';
@import '@idds/styles/tailwind/css/panrb.css'; /* Optional: brand theme */Or use minified versions for production:
@import '@idds/styles/tailwind/css/idds.min.css';
@import '@idds/styles/tailwind/css/panrb.min.css';Then you can use classes like:
text-neutral-500bg-blue-500text-guide-500(which uses--ina-blue-500=#0968f6)
Available brand themes (with .min.css versions):
@idds/styles/tailwind/css/idds.css- Default theme@idds/styles/tailwind/css/inagov.css- INAGov brand@idds/styles/tailwind/css/inaku.css- INAKu brand@idds/styles/tailwind/css/inapas.css- INAPas brand@idds/styles/tailwind/css/bgn.css- BGN brand@idds/styles/tailwind/css/bkn.css- BKN brand@idds/styles/tailwind/css/lan.css- LAN brand@idds/styles/tailwind/css/panrb.css- panrb brand
Example Usage
<!-- Using Tailwind classes with INA Digital colors -->
<div class="bg-blue-500 text-white p-4">
<p class="text-guide-500">This text uses guide-500 color (#0968f6)</p>
<p class="text-neutral-500">This text uses neutral-500 color</p>
</div>License
MIT
