Search code examples
csssassionic3

ionic3 custom style with scss


app.scss

.background {
    background-color: blue !important;
}

The code above doesn't work in my ionic project, but if I change it to the following formats, it works.

[background] {
    background-color: blue !important;
}

In my view, . means style class. And I can use it like the following

<ion-content background></ion-content>

What does [] mean?

Is there anything wrong in my project?


Solution

  • The brackets [] in css mean you accessing an attribute therefor background is correct as it points to any HTML-tag element which has an background attribute. If you want to use the dot . you need to add a class the element class="classname".