Comments (4)
Hi @blakehilliard, this is an interesting question. There may be a few work arounds but the easiest may be creating a custom theme based off the HPE theme. With this approach your HPE theme will stay version controlled and up-to-date.
import { hpe } from 'grommet-theme-hpe';
import { deepMerge } from 'grommet/utils';
import { Grommet } from 'grommet';
const theme = deepMerge(hpe, {
global: {
font: {
family: "'Metric', Arial, sans-serif",
face: `
@font-face {
font-family: "Metric";
src: url("/public/MetricHPE-Web-Regular.woff") format('woff');
}
@font-face {
font-family: "Metric";
src: url("/public/MetricHPE-Web-Bold.woff") format('woff');
font-weight: 700;
}
@font-face {
font-family: "Metric";
src: url("/public/web/MetricHPE-Web-Semibold.woff") format('woff');
font-weight: 600;
}
@font-face {
font-family: "Metric";
src: url("/public/MetricHPE-Web-Light.woff") format('woff');
font-weight: 100;
}
`,
},
},
});
export const MyApp = () => <Grommet theme={theme}></Grommet>;
In this approach we assume you have a static assets directory in your web app titled /public
that is serving the .woff
files. You can find the font file links in the src.
If you do not have a static assets directory in your app you could take a more advanced approach by base64ing the fonts and putting the output directly in the src
field of the @font-face
definition.
from grommet-theme-hpe.
and this one is my main.css file
while I am using this way my font works properly.
Thanks!
from grommet-theme-hpe.
Looks like you're good to go. Let us know if you have any other questions!
from grommet-theme-hpe.
Yes! this link help me partially. Whenever I had to use global--> font--> family and face both keys and values so it was not working while I had use only family key and value here and font-face defined in my main.css file so its work properly.
Thanks for your response.
from grommet-theme-hpe.
Related Issues (20)
- Brand Refresh - Write migration guide HOT 4
- Brand Refresh - Publish v5 HOT 2
- Calendar - fontSize is ignored HOT 4
- NameValueList loses responsiveness on resizing HOT 3
- DataTable - units are not an accessible color HOT 2
- Accordion - border colors with opacity result in inconsistent accordion borders
- Button badge alignment on Safari HOT 2
- Design Tokens - Build step to resolve token values HOT 1
- Tag - Update medium tag in HPE theme HOT 1
- How to change the button primary background color from green? HOT 4
- How to change the default font? HOT 3
- PageHeader doesn't properly handle xsmall breakpoint when responsive="true"
- Update Tag to use Close icon HOT 4
- Discussion - Update typography to use `rem`
- Add missing gradients
- Add `data.button.kind` to HPE theme
- Add readonly styling HOT 1
- Add support for styled-components v6 so it can be used with TypeScript HOT 1
- Update "Select" component selected background and selected + hover background HOT 2
- Add ToggleGroup styles
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grommet-theme-hpe.