in .scss variables: .bg-style...">

Ionic2: cannot set background color <ion-content> in .scss variables

in html:

<ion-content class="bg-style"> 

in .scss variables:

 .bg-style { background-color: #f5f0eb; } 

the codes above do not work, but can work in other tags, such as <a> <div> , etc., and when I put the style file (.scss, for example test.scss) in the same path as the file html, it may also work well. I do not know if my question is clear, thanks for the help.

+5
source share
3 answers

use the app.scss file instead of variables.scss .

app.scss

  .bg-style { background: #f5f0eb; } 
+6
source

add style in app.scss file

 .fixed-content{ background-color: #f5f0eb; } 

it will apply to all pages, and you do not need to add a class to each ion-content

+2
source

I would recommend you override ion variables

 $background-color: #f5f0eb !default; $background-ios-color: #f5f0eb !default; $background-md-color: #f5f0eb !default; 

Check this url for more details - link

+1
source

Source: https://habr.com/ru/post/1265689/


All Articles