# All files / src/link styles.ts

100% Statements 51/51
100% Branches 2/2
100% Functions 2/2
100% Lines 51/51

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
    45
    46
    47
    48
    49
    50
    51
    521x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    21x
    21x
    21x
    21x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    1x
    18x
    18x
    18x
    18x
    18x
    18x
    18x
    18x
    18x
    18x
    18x
    18x
     import { cnb } from "cnbuilder";
    import { bem } from "../utils/bem.js";

    const styles = bem("rmd-link");

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

      /** @defaultValue `false` */
      flex?: boolean;
    }

    /**
     * This really doesn't do much at this time since it only merges `rmd-link` with
     * the optional className. This was mostly added just for convention purposes.
     *
     * @remarks \@since 6.0.0
     */
    export function link(options: LinkClassNameOptions = {}): string {
      const { flex, className } = options;

      return cnb(styles({ flex }), className);
    }

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

      /**
       * @defaultValue `false`
       */
      unstyled?: boolean;
    }

    /**
     * @remarks \@since 6.0.0
     */
    export function skipToMainContent(
      options: SKipToMainContentClassNameOptions = {}
    ): string {
      const { unstyled = false, className } = options;

      return cnb(
        styles({
          skip: true,
          "skip-styled": !unstyled,
        }),
        className
      );
    }