การกำหนดค่า CSS เพื่อใช้ร่วมกันทั้งแอพ
กำหนดไว้ในไฟล์ src/theme/variables.scss
แก้ไขไฟล์ src/pages/home/home.html
1 2 3 4 5 6 7 8 9 10 11 |
<ion-header> <ion-navbar color="danger"> <ion-title> Ionic Blank </ion-title> </ion-navbar> </ion-header> <ion-content padding> เปลี่ยนสี navbar </ion-content> |
บรรทัดที่ 2: เพิ่ม color="danger"
การเปลี่ยน Font
เลือก Google Fonts ที่ https://fonts.google.com
โดยคลิกที่ฟอน์ตที่ต้องการ จากนั้นเลือก Select – Embed – @import แล้ว copy ค่ามาใส่ที่ ไฟล์ src/theme/variables.scss
แก้ไขไฟล์ src/theme/variables.scss
ในส่วนของฟอน์ต
[code]
// Fonts
// ————————————————–
@import "roboto";
@import "noto-sans";
@import url(‘https://fonts.googleapis.com/css?family=Itim’);
*{
font-family: ‘Itim’, cursive;
}
[/code]
Note: การใส่ * เป็นการบอกว่าให้ใช้ฟอน์ตนี้กับทั้งแอพเลย
[BOXMOBILEDEV] Ionic 3 EP5 : ตกแต่ง scss และ Font ที่ต้องการ