Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 10 additions & 55 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,84 +1,39 @@
---
sectionTitle: Design
sectionTitle: BCC Tokens 2.0
---

# BCC Design System
# BCC Tokens 2.0

Build consistent BCC applications with design tokens and components.
Design tokens for building consistent BCC applications.

## Quick Start

Install the package:

```bash
npm install @bcc-code/design-tokens
```

Import in your CSS:

```css
@import "@bcc-code/design-tokens/tailwind";
```

Use in your HTML:

```html
<div class="bg-elevation-surface-default text-default p-200 radius-md">
Your content
</div>
```

That's it. You now have access to all BCC design tokens as Tailwind classes.

## Packages

| Package | What it does | Install |
|---------|--------------|---------|
| [@bcc-code/design-tokens](./tokens/) | Colors, typography, spacing as CSS/Tailwind | `npm i @bcc-code/design-tokens` |
| [@bcc-code/icons-vue](./assets/icons/) | 200+ Vue 3 icon components | `npm i @bcc-code/icons-vue` |
| [Logo assets](./assets/logos.md) | CDN-hosted BCC logos | No install needed |

## Common Examples

### Card with proper spacing

```html
<div class="bg-elevation-surface-default p-300 radius-lg shadow-sm">
<h2 class="text-heading-md text-default">Card Title</h2>
<p class="text-body-md text-secondary mt-100">Card content goes here.</p>
</div>
```

### Button with brand colors

```html
<button class="bg-interactive-brand text-on-interactive px-300 py-100 radius-md">
Click me
</button>
```

### Using an icon

```vue
<script setup>
import { HomeIcon } from '@bcc-code/icons-vue'
</script>

<template>
<HomeIcon class="w-6 h-6 text-default" />
</template>
```

## Next Steps
## Documentation

- **[Design Tokens](./tokens/)** - Full token reference and setup options
- **[Guidelines](./tokens/guidelines.md)** - Do's and don'ts for using the system
- **[Icons](./assets/icons/)** - Browse available icons
| Section | Description |
|---------|-------------|
| [Getting Started](./getting-started/) | Installation and setup guides |
| [Core Concepts](./core-concepts/) | Colors, spacing, typography, dark mode |
| [Assets](./assets/) | Icons and logos |

## Resources

| Resource | Link |
|----------|------|
| Figma tokens | [BCC Foundation - Master](https://www.figma.com/file/jtWn3ebee6bJnWpfZrJzq1/BCC-Foundation---Master) |
| Figma | [BCC Foundation - Master](https://www.figma.com/file/jtWn3ebee6bJnWpfZrJzq1/BCC-Foundation---Master) |
| npm | [@bcc-code/design-tokens](https://www.npmjs.com/package/@bcc-code/design-tokens) |
| GitHub | [bcc-code/bcc-design](https://github.com/bcc-code/bcc-design) |
8 changes: 4 additions & 4 deletions docs/assets/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
sectionTitle: Assets
sectionOrder: 40
sectionOrder: 30
---

# Assets

Brand assets for BCC applications.
Visual assets for BCC applications.

- [Icons](./icons/) - SVG icons based on Material Symbols
- [Logos](./logos.md) - CDN-hosted logo assets
- [Icons](./icons.md) - SVG icon library
- [Logos](./logos.md) - CDN-hosted logo files
5 changes: 5 additions & 0 deletions docs/assets/icons/README.md → docs/assets/icons.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
title: Icons
order: 1
---

# Icons

SVG icons based on [Material Symbols](https://fonts.google.com/icons) with **Weight 400**, **Grade 0**, **Size 24**.
Expand Down
8 changes: 6 additions & 2 deletions docs/assets/logos.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
title: Logos
order: 2
---

# Logos

## Quickstart
Expand Down Expand Up @@ -28,7 +33,7 @@ https://design.bcc.no/logos/organisation-name_logo_color_size.png
|:------------------ |:--------------------------------------------------------- |:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| bcc_logo_primary | [[svg]](https://design.bcc.no/logos/bcc_logo_primary.svg) | [[32]](https://design.bcc.no/logos/bcc_logo_primary_dark-green_32.png) - [[48]](https://design.bcc.no/logos/bcc_logo_primary_dark-green_48.png) - [[64]](https://design.bcc.no/logos/bcc_logo_primary_dark-green_64.png) - [[72]](https://design.bcc.no/logos/bcc_logo_primary_dark-green_72.png) | [[32]](https://design.bcc.no/logos/bcc_logo_primary_white_32.png) - [[48]](https://design.bcc.no/logos/bcc_logo_primary_white_48.png) - [[64]](https://design.bcc.no/logos/bcc_logo_primary_white_64.png) - [[72]](https://design.bcc.no/logos/bcc_logo_primary_white_72.png) |
| bcc_logo_secondary | [[svg]](https://design.bcc.no/logos/bcc_logo_secondary.svg) | [[32]](https://design.bcc.no/logos/bcc_logo_secondary_dark-green_32.png) - [[48]](https://design.bcc.no/logos/bcc_logo_secondary_dark-green_48.png) - [[64]](https://design.bcc.no/logos/bcc_logo_secondary_dark-green_64.png) - [[72]](https://design.bcc.no/logos/bcc_logo_secondary_dark-green_72.png) | [[32]](https://design.bcc.no/logos/bcc_logo_secondary_white_32.png) - [[48]](https://design.bcc.no/logos/bcc_logo_secondary_white_48.png) - [[64]](https://design.bcc.no/logos/bcc_logo_secondary_white_64.png) - [[72]](https://design.bcc.no/logos/bcc_logo_secondary_white_72.png) |
| bcc_logo_full | [[svg]](https://design.bcc.no/logos/bcc_logo_full.svg) | [[32]](https://design.bcc.no/logos/bcc_logo_full_dark-green_32.png) - [[48]](https://design.bcc.no/logos/bcc_logo_full_dark-green_48.png) - [[64]](https://design.bcc.no/logos/bcc_logo_full_dark-green_64.png) - [[72]](https://design.bcc.no/logos/bcc_logo_full_dark-green_72.png) | [[32]](https://design.bcc.no/logos/bcc_logo_full_white_32.png) - [[48]](https://design.bcc.no/logos/bcc_logo_full_white_48.png) - [[64]](https://design.bcc.no/logos/bcc_logo_full_white_64.png) - [[72]](https://design.bcc.no/logos/bcc_logo_full_white_72.png) |
| bcc_logo_full | [[svg]](https://design.bcc.no/logos/bcc_logo_full.svg) | [[32]](https://design.bcc.no/logos/bcc_logo_full_dark-green_32.png) - [[48]](https://design.bcc.no/logos/bcc_logo_full_dark-green_48.png) - [[64]](https://design.bcc.no/logos/bcc_logo_full_dark-green_64.png) - [[72]](https://design.bcc.no/logos/bcc_logo_full_dark-green_72.png) | [[32]](https://design.bcc.no/logos/bcc_logo_full_white_32.png) - [[48]](https://design.bcc.no/logos/bcc_logo_full_white_48.png) - [[64]](https://design.bcc.no/logos/bcc_logo_full_white_64.png) - [[72]](https://design.bcc.no/logos/bcc_logo_full_white_72.png) |
| bcc_logo_symbol | [[svg]](https://design.bcc.no/logos/bcc_logo_symbol.svg) | [[32]](https://design.bcc.no/logos/bcc_logo_symbol_dark-green_32.png) - [[48]](https://design.bcc.no/logos/bcc_logo_symbol_dark-green_48.png) - [[64]](https://design.bcc.no/logos/bcc_logo_symbol_dark-green_64.png) - [[72]](https://design.bcc.no/logos/bcc_logo_symbol_dark-green_72.png) | [[32]](https://design.bcc.no/logos/bcc_logo_symbol_white_32.png) - [[48]](https://design.bcc.no/logos/bcc_logo_symbol_white_48.png) - [[64]](https://design.bcc.no/logos/bcc_logo_symbol_white_64.png) - [[72]](https://design.bcc.no/logos/bcc_logo_symbol_white_72.png) |

| **Organisation** | **SVG** | **PNG - Dark green** | **PNG - White** |
Expand Down Expand Up @@ -68,4 +73,3 @@ https://design.bcc.no/logos/organisation-name_logo_color_size.png
| **Organisation** | **SVG** | **PNG - Dark green** | **PNG - White** |
|:------------------ |:--------------------------------------------------------- |:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| bcc-norge | [[svg]](https://design.bcc.no/logos/bcc-norge_logo.svg) | [[32]](https://design.bcc.no/logos/bcc-norge_logo_dark-green_32.png) - [[48]](https://design.bcc.no/logos/bcc-norge_logo_dark-green_48.png) - [[64]](https://design.bcc.no/logos/bcc-norge_logo_dark-green_64.png) - [[72]](https://design.bcc.no/logos/bcc-norge_logo_dark-green_72.png) | [[32]](https://design.bcc.no/logos/bcc-norge_logo_white_32.png) - [[48]](https://design.bcc.no/logos/bcc-norge_logo_white_48.png) - [[64]](https://design.bcc.no/logos/bcc-norge_logo_white_64.png) - [[72]](https://design.bcc.no/logos/bcc-norge_logo_white_72.png) |

14 changes: 14 additions & 0 deletions docs/core-concepts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
sectionTitle: Core Concepts
sectionOrder: 20
---

# Core Concepts

Learn how to use BCC design tokens effectively.

- [Colors](./colors.md) - Semantic color tokens
- [Spacing](./spacing.md) - Consistent spacing scale
- [Typography](./typography.md) - Fonts and text styles
- [Dark Mode](./dark-mode.md) - Theme switching
- [Guidelines](./guidelines.md) - Do's and don'ts
82 changes: 82 additions & 0 deletions docs/core-concepts/colors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
title: Colors
order: 1
---

# Colors

Use semantic color tokens instead of hardcoded values. Semantic tokens automatically adapt to light and dark modes.

## Text Colors

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be an idea to show the tokens visually too?

You can embed a Vue component which will be rendered as part of the documentaiton

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Planning to take it on the next update.

| Token | CSS Variable | Tailwind Class |
|-------|--------------|----------------|
| Default | `--color-text-default` | `text-default` |
| Subtle | `--color-text-subtle` | `text-subtle` |
| Subtlest | `--color-text-subtlest` | `text-subtlest` |
| Disabled | `--color-text-disabled` | `text-disabled` |
| Inverse | `--color-text-inverse` | `text-inverse` |
| Brand | `--color-text-brand-default` | `text-brand-default` |
| Success | `--color-text-success` | `text-success` |
| Danger | `--color-text-danger` | `text-danger` |
| Warning | `--color-text-warning-default` | `text-warning-default` |
| Information | `--color-text-information` | `text-information` |

## Background Colors

| Token | CSS Variable | Tailwind Class |
|-------|--------------|----------------|
| Surface Default | `--color-elevation-surface-default` | `bg-elevation-surface-default` |
| Surface Raised | `--color-elevation-surface-raised` | `bg-elevation-surface-raised` |
| Surface Overlay | `--color-elevation-surface-overlay` | `bg-elevation-surface-overlay` |
| Surface Sunken | `--color-elevation-surface-sunken` | `bg-elevation-surface-sunken` |

## Border Colors

| Token | CSS Variable | Tailwind Class |
|-------|--------------|----------------|
| Default | `--color-border-default` | `border-default` |
| Subtle | `--color-border-subtle` | `border-subtle` |
| Bold | `--color-border-bold` | `border-bold` |

## Interactive Colors

| Token | CSS Variable | Tailwind Class |
|-------|--------------|----------------|
| Primary | `--color-interactive-primary` | `bg-interactive-primary` |
| Primary Hover | `--color-interactive-primary-hover` | `bg-interactive-primary-hover` |
| On Interactive | `--color-text-on-interactive` | `text-on-interactive` |

## Example

```html
<div class="bg-elevation-surface-default border border-default text-default p-200">
<p class="text-subtle">Secondary text</p>
<button class="bg-interactive-primary text-on-interactive px-200 py-100 rounded-md">
Action
</button>
</div>
```

## Do's and Don'ts

| Do | Don't | Why |
|----|-------|-----|
| `text-default` | `text-gray-900` | Adapts to dark mode |
| `text-subtle` | `text-gray-600` | Maintains contrast |
| `bg-elevation-surface-default` | `bg-white` | Theme-aware |
| `border-default` | `border-gray-200` | Consistent |

## Accent Colors

For specific accent needs, semantic accent tokens are available:

- `text-accent-gray-default`, `text-accent-gray-bold`
- `text-accent-blue-default`, `text-accent-blue-bold`
- `text-accent-teal-default`, `text-accent-teal-bold`
- `text-accent-green-default`, `text-accent-green-bold`
- `text-accent-yellow-default`, `text-accent-yellow-bold`
- `text-accent-orange-default`, `text-accent-orange-bold`
- `text-accent-red-default`, `text-accent-red-bold`
- `text-accent-magenta-default`, `text-accent-magenta-bold`
- `text-accent-purple-default`, `text-accent-purple-bold`
51 changes: 51 additions & 0 deletions docs/core-concepts/dark-mode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: Dark Mode
order: 4
---

# Dark Mode

All semantic tokens automatically adapt to dark mode. No additional configuration needed.

## Enable Dark Mode

Add the `dark` class to your HTML element:

```html
<html class="dark">
```

## Toggle Programmatically

```js
// Toggle dark mode
document.documentElement.classList.toggle("dark");

// Check current mode
const isDark = document.documentElement.classList.contains("dark");
```

## PrimeVue Setup

If using PrimeVue, configure the dark mode selector:

```js
app.use(PrimeVue, {
theme: {
preset: BCCPreset,
options: { darkModeSelector: ".dark" },
},
});
```

## Testing

Always test components in both light and dark modes. Hardcoded colors break dark mode.

```html
<!-- Wrong: breaks in dark mode -->
<div class="bg-white text-black shadow-lg">

<!-- Right: works in both modes -->
<div class="bg-elevation-surface-raised text-default shadow-md">
```
73 changes: 73 additions & 0 deletions docs/core-concepts/guidelines.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
title: Guidelines
order: 5
---

# Guidelines

Best practices for using BCC Design Tokens.

## Components

Use PrimeVue with the BCC preset. Building from scratch creates inconsistency.

| Do | Don't |
|----|-------|
| Use PrimeVue components | Build custom components from scratch |
| Apply BCC preset first | Start with unstyled components |
| Extend existing components | Fork and modify component source |
| Override specific tokens | Override all component styles |

## Common Mistakes

### Mixing Token Systems

Never mix BCC tokens with default Tailwind classes.

```html
<!-- Wrong: mixing systems -->
<div class="p-4 text-default bg-white border-gray-200">

<!-- Right: all BCC tokens -->
<div class="p-200 text-default bg-elevation-surface-default border-default">
```

### Hardcoding Colors in CSS

Use CSS custom properties instead of hex values.

```css
/* Wrong */
.card {
background: #ffffff;
color: #1a1a1a;
}

/* Right */
.card {
background: var(--color-elevation-surface-default);
color: var(--color-text-default);
}
```

## When to Use Custom Values

Custom values are acceptable in specific situations.

| Situation | Approach | Example |
|-----------|----------|---------|
| One-off layout dimensions | Tailwind arbitrary values | `w-[347px]` |
| Animation timing | Define in component styles | `transition: 200ms` |
| Third-party library | Match their API, wrap with tokens | Use tokens for colors |

If using the same custom value more than twice, request it as a token.

## Checklist

Before submitting code:

- [ ] No hardcoded color values (`#fff`, `white`, `gray-900`)
- [ ] No default Tailwind spacing (`p-4`, `m-2`, `gap-6`)
- [ ] All colors use semantic tokens (`text-default`, `bg-elevation-*`)
- [ ] Component works in dark mode
- [ ] Using PrimeVue components where available
Loading