npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@fabric-msft/theme

v4.0.0

Published

Fabric theme provides a set of CSS variables that can be used to style your application. It provides a theme object and a setTheme function to apply the theme to the page.

Readme

@fabric-msft/theme

Fabric theme provides a set of CSS variables that can be used to style your application. It provides a theme object and a setTheme function to apply the theme to the page.

import { fabricLightTheme, setTheme } from "@fabric-msft/theme";

setTheme(fabricLightTheme);

// or use the base fluent theme
// setTheme(webLightTheme);

Fabric Semantic Tokens

Fabric provides semantic tokens for icon coloring that can be used in your components:

// Import directly if needed
import {
  fabricSemanticTokensLight,
  fabricSemanticTokensDark
} from "@fabric-msft/theme";

Available Tokens

Standard Icon Colors

  • iconErrorColor: For error states
  • iconValidationColor: For success states
  • iconSystemColor: For system icons
  • iconContentManagementColor: For content management
  • iconMonitoringColor: For monitoring indicators
  • iconMiscColor: For miscellaneous icons

Ribbon Icon Colors

  • colorRibbonIconError: For ribbon error icons
  • colorRibbonIconValidation: For ribbon validation icons
  • colorRibbonIconSysconfig: For ribbon system configuration icons
  • colorRibbonIconContentMgt: For ribbon content management icons
  • colorRibbonIconMonitoring: For ribbon monitoring icons
  • colorRibbonIconMisc: For ribbon miscellaneous icons

Ribbon Icon Disabled States

  • colorRibbonIconErrorDisabled: Disabled error icons in ribbons
  • colorRibbonIconValidationDisabled: Disabled validation icons
  • colorRibbonIconSysconfigDisabled: Disabled system config icons
  • colorRibbonIconContentMgtDisabled: Disabled content management icons
  • colorRibbonIconMonitoringDisabled: Disabled monitoring icons
  • colorRibbonIconMiscDisabled: Disabled miscellaneous icons

Using in CSS

/* Standard icon colors */
.error-icon {
  fill: var(--iconErrorColor);
}

/* Ribbon icon colors */
.ribbon-system-icon {
  fill: var(--colorRibbonIconSysconfig);
}

/* Disabled ribbon icons */
.disabled-monitoring-icon {
  fill: var(--colorRibbonIconMonitoringDisabled);
}

Using in Web Components

import { css } from "@microsoft/fast-element";

export const styles = css`
  .content-management-icon {
    fill: var(--iconContentManagementColor);
  }

  .ribbon-validation-icon {
    fill: var(--colorRibbonIconValidation);
  }

  .ribbon-validation-icon[disabled] {
    fill: var(--colorRibbonIconValidationDisabled);
  }
`;

Testing Locally

You can quickly test semantic tokens in a browser with these steps:

1. Build and Pack the Library

# Build the theme library
cd libs/theme
yarn build

# Create a local package
yarn pack-dist

2. Create a Simple Test Page

Create a simple HTML file to test the tokens:

<!DOCTYPE html>
<html>
  <head>
    <title>Semantic Token Test</title>
    <style>
      .test-container {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
      }
      .color-sample {
        width: 100px;
        height: 100px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-weight: bold;
        border-radius: 8px;
      }
      .switch-theme {
        margin: 20px 0;
      }
    </style>
  </head>
  <body>
    <h1>Fabric Semantic Tokens Test</h1>

    <button id="themeToggle" class="switch-theme">Switch Theme</button>

    <div class="test-container" id="tokenContainer"></div>

    <script type="module">
      import {
        fabricLightTheme,
        fabricDarkTheme,
        setTheme
      } from "./node_modules/@fabric-msft/theme/dist/index.js";

      // Initialize with light theme
      let isDarkTheme = false;
      setTheme(fabricLightTheme);

      // Token display helper
      function displayTokens() {
        const container = document.getElementById("tokenContainer");
        container.innerHTML = "";

        const currentTheme = isDarkTheme ? fabricDarkTheme : fabricLightTheme;

        // Get all semantic tokens and display them
        Object.keys(currentTheme)
          .filter(
            (key) => key.startsWith("icon") || key.startsWith("colorRibbon")
          )
          .forEach((token) => {
            const div = document.createElement("div");
            div.className = "color-sample";
            div.style.backgroundColor = `var(--${token})`;
            div.textContent = token;
            container.appendChild(div);
          });
      }

      // Theme toggle
      document.getElementById("themeToggle").addEventListener("click", () => {
        isDarkTheme = !isDarkTheme;
        setTheme(isDarkTheme ? fabricDarkTheme : fabricLightTheme);
        displayTokens();
      });

      // Initial display
      displayTokens();
    </script>
  </body>
</html>

3. Test with a Local Server

Serve your test page using any local server, for example:

# Using npx and a simple http server
npx http-server -o

# Or with Python
python -m http.server

Navigate to the test page in your browser to visualize all semantic tokens and verify they work as expected in both light and dark themes.