score:0
to do that you need to split the font file outside the scss build, for example, you can set it inside public html in the fonts
directory and use it. (i do that for some of the external recourse and its work)
now how you can do that: (example)
<link rel="preload" href="fonts/cicle_fina-webfont.woff2" as="font" type="font/woff2" crossorigin>
and then you can add:
@font-face {
font-family: 'ciclefina';
src: url('fonts/cicle_fina-webfont.eot');
src: url('fonts/cicle_fina-webfont.eot?#iefix') format('embedded-opentype'),
url('fonts/cicle_fina-webfont.woff2') format('woff2'),
url('fonts/cicle_fina-webfont.woff') format('woff'),
url('fonts/cicle_fina-webfont.ttf') format('truetype'),
url('fonts/cicle_fina-webfont.svg#ciclefina') format('svg');
font-weight: normal;
font-style: normal;
}
or you can move fonts and css for these fonts to the public html directory and add preload direct in index.html
or you can add to index.html: <link rel="preload" href="yourfont.woff2" as="font" />
Source: stackoverflow.com
Related Query
- React CRA: Preload fonts from fonts folder
- Serve files from `.well-known` folder in a React app
- How to import file from public folder in react application?
- Importing from shared folder from react native
- react router preload data from multiple components with a single loader animation
- React import images from public folder
- ReferenceError: React is not defined - Migrating from CRA to Vite and NX
- Can“t access my public folder from css file in React App
- unable to display svg's from local folder using React js
- Cannot import from public folder in CSS Create React App
- Dynamically change background images in React from local folder
- React import multiple components from a folder
- React svg from public folder
- import module from a sub folder in react js
- React load fonts dynamically from the backend
- Proper way to load local stored images from folder in React
- How to set a background image from the public folder in React (Create React App)
- How to pass a Json data from one folder to another folder in react
- Preload Images from URL React
- create react app and SVG from node modules folder
- react CRA - exclude debug code from build
- React Native app created with init not working if i moved from one folder to other
- How can I require react components from a local folder without node_modules from a globally installed node app?
- Load CSS from different folder in react
- How to call function from App.js file inside public folder in React JS
- Could not fetch local JSON file from public folder in React
- want to upload zip folders from react UI and send it to backend node js server from where i can place that folder in a ceratin path on my system
- import css from public folder to any react component
- How do I add pictures from my assets folder to my React Application?
- Is there any way to import JavaScript function to React component outside from src folder
More Query from same tag
- React Router with redirection to login page but also to have 404 NotFound route
- What is the difference between React.Component and Component?
- I want each of my items in the itemslist to have an image matching to it
- React Nested Route with params
- How to import ReactJS Material UI using a CDN through Webpack's externals?
- localStorage state value of undefined after refresh
- How do I test the method shouldComponentUpdate?
- react-mapbox-gl accessing lat and lon on click
- Change props depending on breakpoint with SSR support
- How to add Link to my react-bootstrap Card for changing URL path
- passing icon to the parent component
- How to Insert Content in tinymce Editor without triggering focus on editor?
- I have 2 components and I want a 3rd component to show animation while waiting for the 2nd one to load images
- How to convert data array object to file JSON and use this file to send requests to the S3 server in ReactJS?
- I want to add value to an array on click in react
- How to pass React component as regular JS to react-test-renderer
- Component cannot be used as a JSX component
- Setting and getting state from session storage react
- Escape colon in Reactive Search field name
- How to pass Material UI data to Formik?
- How to get the form validation status in "react-validation", when submitting the form?
- Input an array from a form and post it to the server in ReactJs
- reactjs/react-router-dom: Browserrouter routing question
- AG-Grid React, trouble getting custom cell renderer to update when data changes. Function components are behaving differently than class components
- In React, why route can work properly without path
- if-else is not working in scss with react
- Cannot read property of undefined React Hooks
- Hooking into component
- prevent ant design modal outside clicking closing modal
- React MaterialUI Card: how to change Card's class on expand? -> Custom React component