4.6.6 • Published 2 years ago

@equinor/opt-ui-styles v4.6.6

Weekly downloads
552
License
MIT
Repository
github
Last release
2 years ago

@equinor/opt-ui-styles

Component part of OPT-UI. This package host the components style and the theming system functionality for @equinor/opt-ui-core.

Installation

Install the package in your project directory with:

// with npm
npm install @equinor/opt-ui-styles

// with yarn
yarn add @equinor/opt-ui-styles

Usage of the CSSBaseline

This package offers a global css that acts as a normalize css for all the custom styles in OPT.

To used, it only need to be added once in all the code. The best part to add it is on the root when the app is rendered. For example:

import { CSSBaseline } from "@equinor/opt-ui-styles";

ReactDOM.render(
  <>
    <CSSBaseline />
    <App />
  </>,
  document.getElementById("app")
);

Usage of the ThemeProvider

This package offers a theme provider that allows to have light or dark theme or even a totally different set up of colors.

It can be used in any part of the code but we recommend to add it is on the root when the app is rendered

Light mode

import { ThemeProvider } from "@equinor/opt-ui-styles";

ReactDOM.render(
  <>
    <ThemeProvider mode="light">
      <App />
    </ThemeProvider>
  </>,
  document.getElementById("app")
);

Dark mode

import { ThemeProvider } from "@equinor/opt-ui-styles";

ReactDOM.render(
  <>
    <ThemeProvider mode="dark">
      <App />
    </ThemeProvider>
  </>,
  document.getElementById("app")
);

Note: if you also use the CSSBaseline you should place it inside the ThemeProvider.

4.6.6

2 years ago

4.6.4

3 years ago

4.6.2

3 years ago

4.6.1

3 years ago

4.6.0

3 years ago

4.5.0

3 years ago

4.5.2

3 years ago

4.5.1

3 years ago

4.4.0

3 years ago

4.3.2

3 years ago

4.3.1

3 years ago

4.3.4

3 years ago

4.3.3

3 years ago

4.3.0

3 years ago

4.2.3

3 years ago

4.2.2

3 years ago

4.2.1

3 years ago

4.2.0

3 years ago

4.1.16

3 years ago

4.1.15

3 years ago

4.1.14

3 years ago

4.1.14-alpha.0

3 years ago

4.1.12

3 years ago

4.1.13

3 years ago

4.1.10

3 years ago

4.1.11

3 years ago

4.1.8

3 years ago

4.1.9

3 years ago

4.1.6

3 years ago

4.1.7

3 years ago

4.1.5

3 years ago

4.1.4

3 years ago

4.1.3

3 years ago