Skip to content

Option to specify @font-face's src url() when non-root directory? #17

@PapiPeppers

Description

@PapiPeppers

If running from root of {someDirectory} where the font files are located in {someDirectory}/{otherDir}/{fontDir}, is there a way to output in the @font-face rules a src url() pointing to ./{otherDir}/{fontDir} instead of the root directory?

Currently, output looks like:

@font-face {
  font-family: 'PPFraktionMono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('PPFraktionMono-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'PPFraktionMono Fallback';
  font-style: normal;
  font-weight: 400;
  src: local('Arial');
  ascent-override: 76.51%;
  descent-override: 14.75%;
  line-gap-override: 21.75%;
  size-adjust: 131.49%;
}

html {
  font-family: 'PPFraktionMono', 'PPFraktionMono Fallback';
}

But need output to be this:

@font-face {
  font-family: 'PPFraktionMono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('**/{otherDir}/{fontDir}/**PPFraktionMono-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'PPFraktionMono Fallback';
  font-style: normal;
  font-weight: 400;
  src: local('Arial');
  ascent-override: 76.51%;
  descent-override: 14.75%;
  line-gap-override: 21.75%;
  size-adjust: 131.49%;
}

html {
  font-family: 'PPFraktionMono', 'PPFraktionMono Fallback';
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions