Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fluentui/react-theme

Package Overview
Dependencies
Maintainers
0
Versions
813
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fluentui/react-theme

Fluent UI themes

  • 0.0.0-nightly-20241220-0406.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
118K
increased by57.41%
Maintainers
0
Weekly downloads
 
Created
Source

@fluentui/react-theme

React Theme for Fluent UI React

Usage

Import a theme and tokens:

import { webLightTheme, tokens } from '@fluentui/react-components';

Pass the theme to the FluentProvider:

<FluentProvider theme={webLightTheme}>
  <App />
</FluentProvider>

Use the tokens in your styles:

const useStyles = makeStyles({
  root: {
    color: tokens.colorNeutralForeground1,
  },
});

Using a custom brand ramp

To use a theme based on a custom brand ramp, use the createXXXTheme function:

import { createWebLightTheme } from '@fluentui/react-components';

const customBrandRamp: BrandVariants = {
  10: `#2b2b40`,
  // ...
  160: `#e8ebfa`,
};

const customTheme = createWebLightTheme(customBrandRamp);

Contributing

Updating colors in the theme

The color tokens are generated by token pipeline. Do not edit colors directly. Instead, update the token pipeline first and once the changes are merged there, run:

yarn token-pipeline

Adding new color tokens

To add a new color token, besides updating the token pipeline, you also need to update corresponding typings and the tokens object in src/tokens.ts.

Updating other tokens

To update any tokens not related to colors, update the values directly in this package.

FAQs

Package last updated on 20 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc