I've been attempting to modify the overall font-family for my application, but so far, I haven't had any luck.
Since I'm working with Semantic-UI-React, I initially thought that could be the issue. However, when I tried to locate src/site/globals/site.variables
(which other solutions have mentioned) in order to adjust the global variables, I discovered that these files are not present within the Semantic-UI-React node module. I also experimented with using !important
on both the #root
of my application and the
.app</code that wraps around all components and deeper levels as well, but it only affected the content within my Semantic Modal.</p>
<p>I imported the fonts in <code>frontend_react/public/index.html
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<link rel="stylesheet" href="/styles.css" >
<link href="https://fonts.googleapis.com/css?family=Cinzel:700,900" rel="stylesheet">
<style>
@import url('https://fonts.googleapis.com/css?family=Cinzel:700,900');
#root {
font-family: 'Cinzel', serif !important;
}
</style>
<title>Three Seeds Tarot</title>
I then referenced the font in /App.css
. I applied it to the body, html
selector in the same way, as well as the page
selector, but without success.
.App {
text-align: center;
background-image: url('http://2.bp.blogspot.com/-kX_5_Cqch4g/UmBAsMV4krI/AAAAAAAADjA/XEJnfAq1Dsg/s1600/ProtectionKamea300dpi(a3).jpg');
font-family: 'Cinzel', serif !important;
}
Here's the render function for my /App.js
component:
render() {
const user = this.props.user
return (
<div className='App'>
<div id='nav-bar'>
<NavBar/>
</div>
<div className='page'>
{!user.loggedIn ? <div>
<header className='App-header'>
<marquee scrollamount='5' direction='right'><img src={image} className='App-logo' alt='logo' /></marquee>
</header>
</div> : null
}
<Switch>
<Route path='/readings/new' component={ NewReading } />
<Route path='/readings' component={ ReadingSplash } />
<Route path='/cards' component={ CardList }/>
<Route exact path='/profile' component={ Profile } />
<Route exact path='/' component={ Welcome } />
<Route exact path='/login' component={ Login } />
<Route exact path='/signup' component={ Signup } />
</Switch>
</div>
</div>
);
}
The only area where the CSS changes have taken effect is within the <p>
tags inside the Semantic UI Modal:
render() {
return (
<div className='card-image'>
<Modal
size='large'
trigger={
<div className="ui medium images" >
<img className="single-card" src={this.getImage(this.props.card.name)} alt="No Image Found" onClick={this.handleClick} />
</div>}
style={inlineStyle.modal}
>
<Modal.Header>{this.props.card.name}</Modal.Header>
<Modal.Content >
<Image wrapped size='medium' src={this.getImage(this.props.card.name)} floated='left' />
<Modal.Description>
<Header>{capitalize(this.props.card.card_type)} Arcana</Header>
<p>Meaning Upright: {this.props.card.meaning_up} </p>
<p>Meaning Reversed: {this.props.card.meaning_rev} </p>
<p>Description: {this.props.card.desc} </p>
</Modal.Description>
</Modal.Content>
<Modal.Actions>
{/* <Button primary onClick={this.modalClose}>Close</Button> */}
</Modal.Actions>
</Modal>
</div>
)
}
In conclusion, I am still striving to change the global font. While I utilized !important
, I understand this isn't the ideal solution. Unfortunately, all the suggestions I've come across involve modifying the global variables for Semantic UI React in the src/site/globals/site.variables
folder, which appears to be missing from my setup.