# All files / src/layout mainStyles.ts

100% Statements 44/44
100% Branches 2/2
100% Functions 1/1
100% Lines 44/44

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    451x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    98x
    98x
    98x
    98x
    98x
    98x
    98x
    98x
    98x
    98x
     import { cnb } from "cnbuilder";
    import { bem } from "../utils/bem.js";

    const styles = bem("rmd-layout-main");

    /**
     * @remarks \@since 6.0.0
     */
    export interface MainClassNameOptions {
      className?: string;

      /**
       * Set this to `true` to apply `margin-left` equal to the current navigation
       * width. If you want this value to animate, use the `useMainClassName` hook
       * instead.
       *
       * @defaultValue `false`
       */
      navOffset?: boolean;

      /**
       * Set this to `true` to apply `padding-top` equal to the height of the main
       * app bar so that content is not covered.
       *
       * @see {@link useLayoutAppBarHeight}
       * @defaultValue `false`
       */
      appBarOffset?: boolean;
    }

    /**
     * @remarks \@since 6.0.0
     */
    export function main(options: MainClassNameOptions = {}): string {
      const { navOffset, appBarOffset, className } = options;

      return cnb(
        styles({
          "offset-v": appBarOffset,
        }),
        navOffset && "rmd-layout-h--active",
        className
      );
    }