Importing the CSS
To include the packages dnb-ui-core
, dnb-ui-components
and dnb-theme-ui
in a Node.js based environment (given you have a CSS loader in place), do this:
// This includes the "dnb-ui-core", "dnb-ui-components" and "dnb-theme-ui"import '@dnb/eufemia/style'
Legacy import
Read more about how to deal with existing styles.
// NB: needs a wrapper class: ".dnb-core-style"import '@dnb/eufemia/style/basis'import '@dnb/eufemia/style/components'import '@dnb/eufemia/style/themes/ui'
No Theme
If You want to import the styles of all components only - without dnb-theme-ui:
// No Theme is includedimport '@dnb/eufemia/style/components'
Custom Theme
You may want to import a theme as well:
// No Theme is includedimport '@dnb/eufemia/style/components'// Default DNB UI Themeimport '@dnb/eufemia/style/theme'
// ... is equivalent to the default themeimport '@dnb/eufemia/style/themes/ui'// ... or some other themeimport '@dnb/eufemia/style/themes/[NAME].css'
Single Component only
It is possible to import a single CSS Style of a single component at once:
// Import the minimum required package: "dnb-ui-basis"import '@dnb/eufemia/style/basis'// Imports only the Button CSS and Main DNB Themeimport '@dnb/eufemia/components/button/style'import '@dnb/eufemia/components/button/style/themes/ui'