How to use the ng-zorro-antd/core.toCssPixel function in ng-zorro-antd

To help you get started, we’ve selected a few ng-zorro-antd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NG-ZORRO / ng-zorro-antd / components / skeleton / nz-skeleton.component.ts View on Github external
toCSSUnit(value: number | string = ''): string {
    return toCssPixel(value);
  }
github NG-ZORRO / ng-zorro-antd / components / message / nz-message-container.component.ts View on Github external
setConfig(config?: NzMessageConfigLegacy): void {
    this.config = this.mergeMessageConfig(config);
    this.top = toCssPixel(this.config.nzTop);
    this.cdr.markForCheck();
  }
github NG-ZORRO / ng-zorro-antd / components / notification / nz-notification-container.component.ts View on Github external
setConfig(config?: NzNotificationConfigLegacy): void {
    const newConfig = (this.config = {
      ...this.config,
      ...config,
      ...this.nzConfigService.getConfigForComponent(NZ_CONFIG_COMPONENT_NAME)
    });
    const placement = this.config.nzPlacement;

    this.top = placement === 'topLeft' || placement === 'topRight' ? toCssPixel(newConfig.nzTop) : null;
    this.bottom = placement === 'bottomLeft' || placement === 'bottomRight' ? toCssPixel(newConfig.nzBottom) : null;

    this.cdr.markForCheck();
  }
github NG-ZORRO / ng-zorro-antd / components / drawer / nz-drawer.component.ts View on Github external
get width(): string | null {
    return this.isLeftOrRight ? toCssPixel(this.nzWidth) : null;
  }
github NG-ZORRO / ng-zorro-antd / components / notification / nz-notification-container.component.ts View on Github external
setConfig(config?: NzNotificationConfigLegacy): void {
    const newConfig = (this.config = {
      ...this.config,
      ...config,
      ...this.nzConfigService.getConfigForComponent(NZ_CONFIG_COMPONENT_NAME)
    });
    const placement = this.config.nzPlacement;

    this.top = placement === 'topLeft' || placement === 'topRight' ? toCssPixel(newConfig.nzTop) : null;
    this.bottom = placement === 'bottomLeft' || placement === 'bottomRight' ? toCssPixel(newConfig.nzBottom) : null;

    this.cdr.markForCheck();
  }
github NG-ZORRO / ng-zorro-antd / components / drawer / nz-drawer.component.ts View on Github external
get height(): string | null {
    return !this.isLeftOrRight ? toCssPixel(this.nzHeight) : null;
  }
github NG-ZORRO / ng-zorro-antd / components / layout / nz-sider.component.ts View on Github external
get widthSetting(): string {
    if (this.nzCollapsed) {
      return `${this.nzCollapsedWidth}px`;
    } else {
      return toCssPixel(this.nzWidth);
    }
  }