Unable to apply Google Font to Ionic2 project - ionic2

I am unable to apply Google Fonts API to my Ionic2 project. Here's what I tried:
app.scss
#font-face {
font-family: 'Yanone Kaffeesatz', sans-serif !important;
}
html, body {
font-family: 'Yanone Kaffeesatz', sans-serif !important;
}
index.html
<link href="https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz" rel="stylesheet">
Why isn't it working?

app.scss
#import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
// Font Variables
$yanone-kaffeesatz: 'Yanone Kaffeesatz', sans-serif !important;
// Styles
html, body {
font-family: $yanone-kaffeesatz;
}
local use
assets/custom-fonts/YanoneKaffeesatz-Regular.ttf
on theme/variables.scss
#font-face {
font-family: 'yanone-kaffeesatz';
src: url('../assets/custom-fonts/YanoneKaffeesatz-Regular.ttf') format('truetype');
}

Related

Code from online cookie popup tutorial not setting cookie

I am trying to set up a cookie policy pop-up on site.
I followed an online tutorial to the letter (I thought) but it doesn't work.
The banner shows up as expected, but on clicking accept, the page seems to refresh but no cookie is set and the banner is still there.
I have looked through the tutorial and all seems to be as he typed. Maybe someone could suggest what could be wrong.
The styles were placed in the css file, but I think the issue must be with the php. I have looked for alternative codes but they are so different I am not sure they would work with this method.
I wonder whether it has something to do with the isset commands.
Also, is there a way to ensure that when the cookie is set and is acknowledged that you stay on the same page rather than going to the root directory?
This is on the top of the html code i.e. before doctype
if (isset($_GET['accept-cookies'])) {
setcookie('accept-cookies', 'true', time() + 31557600);
header('Location: ./');
}
?>
This is the section with the banner (I like the way it looks so prefer not to change the style codes)
if (!isset($_COOKIE['accept-cookies'])) {
?>
<div class="cookie-banner">
<div class="cookie-container">
<p style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 500; font-size: medium;">We use cookies to track usage and preferences. By using this website we will assume that you consent to their use as per our <u>Privacy and Cookie Policy</u>.</p>
<p style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: normal; font-weight: 600; font-size: medium;">Okay</p>
</div>
</div>
<?php
}
?>
Just in case you need it, here are the css parts
background-color: #abd1ff;
padding: 5px 10px;
border-radius: 5px;
display: inline-block;
border: 2px solid #4a6894;
border-bottom: 2px solid #4a6894;
}
.cookie-banner {
background: #6c9bd3;
position: fixed;
top: 0;
left: 0;
width: 98%;
}
.cookie-banner .cookie-container {
margin: 0 auto;
width: 70%;
padding-bottom: 10px;
color: #1f2b3a;
padding: 15px;
}
I was going to add a slide down function, but when I added for it not to display initially in the css code, the banner disappeared even when the js file was referred to with the slide down code.
Any help on what I could add to make it work, what is missing, would be great.
THANK YOU!!!!
No error messages have been seen. Banner just won't disappear and cookie is not set.

The WebStorm do not recognise .vue file

I created a Vue project by Vue-CLI, when I use WebStorm open the project, but the .vue file seems like plain text, there is no highlight syntax.
The code are bellow:
<template>
<div id="app">
<img src="./assets/logo.png">
<h1>{{ msg }}</h1>
<h2>Essential Links</h2>
<ul>
<li>Core Docs</li>
<li>Forum</li>
<li>Community Chat</li>
<li>Twitter</li>
</ul>
<h2>Ecosystem</h2>
<ul>
<li>vue-router</li>
<li>vuex</li>
<li>vue-loader</li>
<li>awesome-vue</li>
</ul>
</div>
</template>
<script>
export default {
name: 'app',
data () {
return {
msg: 'Welcome to Your Vue.js App'
}
}
}
</script>
<style>
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
h1, h2 {
font-weight: normal;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
Make sure that Vue.js plugin is enabled in Preferences | Plugins - it is bundled with recent WebStorm versions. If it's installed and enabled, make sure that *.vue extension is assigned to Vue.js Templates in Preferences | Editor | File Types, and that your don't have App.vue pattern registered for Text file type there
First, add the Vue.js plugin in Preferences | Plugins.
Then you should
Go to : WebStorm -> Preferences -> Editor -> File Types -> HTML:
in the Registered Patterns there is no *.vue.
Add the *.vue in the Registered Patterns like this:
Then apply it.

MailChimp preview overrides link styles

I've run across a problem when creating a custom template for MailChimp - when editing links inside the emails content MailChimp overrides their styles. Here's a part of the template,
<a mc:edit="cta_link" target="_blank" href="*|CUSTOM_URL|*" style="font-family: 'Helvetica', 'Arial', sans-serif !important; font-size: 11px; color: #000000 !important; border-bottom: 1px solid #000000 !important; text-transform: uppercase !important; padding-bottom: 1px;">Read more</a>
As you can see I've also added !important rules to some of the styles to try and avoid any overrides but with no effect. I've switched between having a static example href src and the MailChimp custom url variable, doesn't seem to make any difference.
After updating the link the font changes to a default Times typeface.
Anything I'm missing?
4 years later and it's still happening.
The styles you apply to a link element are overridden by the global link styles.
My solution: insert a span tag inside the link.
<a mc:edit="cta_link" target="_blank" href="*|CUSTOM_URL|*"><span style="font-family: 'Helvetica', 'Arial', sans-serif !important; font-size: 11px; color: #000000 !important; border-bottom: 1px solid #000000 !important; text-transform: uppercase !important; padding-bottom: 1px;">Read more</a>

Custom styling in Foundation

Using Foundation 5
<p class="reverse-text">Blahbuhblah</p>
p.reverse-text {
color: white;
}
This isn't working. Other custom styles I have added work fine. Trying to change color of sidebar paragraph text.
add the css class above the tag
<style>
p.reverse-text {
color: white !important;
}
</style>
<p class="reverse-text">Blahbuhblah</p>

Changing Container Height

I am going through some minor issues here. I am using a standard container height and css code for all pages. For most pages there is enough content to fill it and for some the content may only take 10-20% of the page. So is it a good idea for those pages to use a different min-height? Below is the code:
#wrapper {
background-color: #999999;
margin:0 auto;
min-height: 600px;
width:770px;
font-family: "Lucida Grande", Verdana, "Lucida Sans Unicode", Arial, Helvetica,
sans-serif;
font-size:15px;
color: #222222;
margin-left:60px;
margin-bottom:60px;
}
It might be better to declare the lesser min-height in a separate class.
Then, you could do <div id="wrapper" class="smallerContent">.
#wrapper.smallerContent {
min-height: 300px
}