官术网_书友最值得收藏!

Customizing

Now the basic setup is ready for SASS and also while running ionic serve you will add all custom styling and SASS related changes in all different files for each of the components or pages. Let's start with changing one of the color variables by default present in the variable.scss file:

    /*
To customize the look and feel of
Ionic, you can override the variables

For example, you might change some of
the default colors:


$colors: (
primary: #387ef5,
secondary: #32db64,
danger: #f53d3d,
light: #f4f4f4,
dark: #222,
favorite: #69BB7B,
twitter: #53ACEB,
github: #000000,
instagram: #235D8D
);

// Fastest way to change the theme of
your Ionic app is to set new value
for primary color

You can see that we have added custom colors such as Twitter and GitHub. We can further customize it by supplying base and contrast properties:

    $colors: (
facebook:(
base: #3b5998,
contrast: #ffffff
)
)

You can now use this color key as a property to many components, such as buttons:

<button facebook>Share on Facebook</button>

SASS is really powerful and it speeds up the CSS development process. It acts as a Swiss army knife for CSS, where we can do multiple things with minimum lines of code and then with just some changes we can easily change the entire look and feel of the application. There are so many examples of how we can use SASS, but as we are more into Ionic development, I recommend going through some good SASS documentation and Ionic 3 theming docs once so that detailed information will be provided.

主站蜘蛛池模板: 仁怀市| 广东省| 五莲县| 睢宁县| 夹江县| 武威市| 成安县| 二手房| 佛教| 海晏县| 怀化市| 临安市| 曲沃县| 六盘水市| 丹巴县| 石狮市| 潞城市| 孝昌县| 鄂托克旗| 通渭县| 大田县| 兴文县| 普洱| 进贤县| 曲阳县| 巩义市| 富阳市| 沙雅县| 个旧市| 固原市| 六安市| 铜山县| 雷山县| 溧水县| 崇明县| 闽侯县| 斗六市| 聂拉木县| 闻喜县| 渝中区| 巴塘县|