Skip to content

%PUBLIC_URL% not getting replaced during build while declaring @font-face in stylesheet #829

Closed
@anantzoid

Description

@anantzoid

I have a .ttf file under public/vendor/fonts/Roboto-Regular.ttf and I call it as:

@font-face {
    font-family: 'Roboto';
    src: url('%PUBLIC_URL%/vendor/fonts/Roboto-Regular.ttf');
}

The built file does not does not have the replaced string and thus, the font doesn't load. Is there something that I'm missing?

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