添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Import the ClarityModule into your Angular application's module. Your application's main module might look like this:

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { ClarityModule } from '@clr/angular';
import { AppComponent } from './app.component';
@NgModule({
    imports: [
        BrowserModule,
        ClarityModule,
     declarations: [ AppComponent ],
     bootstrap: [ AppComponent ]
export class AppModule {    }

Include the necessary styles in the build. You can do this by either including the compiled/minified css in your angular.json file or by importing the scss/css directly in your top level styles.scss/css file.

  //...
  "styles": [
    "node_modules/@clr/ui/clr-ui.min.css",
    //... any other styles
  //...
@use '@clr/ui/clr-ui.min.css';

Note: The above instructions represent the best practice for Clarity Design System. For information about accommodating legacy themes, see the Legacy Styles section in the @clr/ui package.

  • Set the Theme Add the cds-theme=”light” attribute to the body element in your main HTML file:
  • <body cds-theme="light" />