How to write custom components in Ionic 2/3 without losing prepared css?

后端 未结 1 936
遥遥无期
遥遥无期 2020-12-18 08:17

When I write my own custom component like this:

import { Component } from \'@angular/core\';

@Component({
  selector: \'deletableItem\',
  template: `
    &         


        
1条回答
  •  囚心锁ツ
    2020-12-18 08:58

    You have to realise Ionic is using SASS and targets multiple platforms. When you create your you have should mimic what the ionic team did with ion-checkbox, and create you Sass files.

    Check out the source folder here for .

    Define your own SASS for deleteableItem.

    Furthermore, on the Ionic website you can find the various SASS component/platform variables.

    I also gave a detailed related explanation, regarding Ionic CSS classes assignment that may help you too.

    You can also use Chrome inspect to see class assignments for ion-checkbox in the Developer tool, and compare them to the list on the Ionic website.

    0 讨论(0)
提交回复
热议问题