本文为原创文章,转载请标明出处

目录

  1. CSS实用属性

    • 文本相关
    • 位置相关
    • padding & margin
  2. 自定义颜色
  3. 平台样式
  4. 覆写Ionic Sass变量
  5. RTL支持

1. CSS实用属性

文本相关

text-{modifier}
text-sm-{modifier} min-width: 576px
text-md-{modifier} min-width: 768px
text-lg-{modifier} min-width: 992px
text-xl-{modifier} min-width: 1200px modifier⬇⬇⬇
第一列为属性,第二列为说明
text-left => text-align: left
text-right => text-align: right
text-start => text-align: start
text-end => text-align: end
text-justify => text-align: justify
text-wrap => white-space: nowrap
text-nowrap => white-space: normal text-uppercase => text-transform: uppercase
text-lowercase => text-transform: lowercase
text-capitalize => text-transform: capitalize

位置相关

float-{modifier}
float-sm-{modifier} min-width: 576px
float-md-{modifier} min-width: 768px
float-lg-{modifier} min-width: 992px
float-xl-{modifier} min-width: 1200px modifier⬇⬇⬇
第一列为属性,第二列为说明
float-left => float: left
float-right => float: right
float-start => float: left | float: right
float-end => float: left | float: right

padding & margin

第一列为属性,第二列为说明
padding => padding: 16px
padding-top => padding-top: 16px
padding-left => padding-left: 16px
padding-right => padding-right: 16px
padding-bottom => padding-bottom: 16px
padding-vertical => padding: 16px 0
padding-horizontal => padding: 0 16px
no-padding => padding: 0 margin => margin: 16px
margin-top => margin-top: 16px
margin-left => margin-left: 16px
margin-right => margin-right: 16px
margin-bottom => margin-bottom: 16px
margin-vertical => margin: 16px 0
margin-horizontal => margin: 0 16px
no-margin => margin: 0

2. 自定义颜色

修改 ./src/theme/variables.scss

$colors: (
primary: #488aff,
secondary: #32db64,
danger: #f53d3d,
light: #f4f4f4,
dark: #222
);

可添加新颜色,如下:

twitter:(
base: #55acee,
contrast: #ffffff
)

base 作为元素背景色,contrast 作为文本颜色

html 中的使用如下:

<button ion-button color="twitter">I'm a button</button>

scss 中的使用如下:

my-component {
background: color($colors, twitter, base);
}

3. 平台样式

第一列为Platform,第二列为Mode
ios => ios
android => md
windows => wp
core => md

默认平台配置属性值:

Config Property DefaultiosValue DefaultmdValue DefaultwpValue
activator "highlight" "ripple" "highlight"
actionSheetEnter "action-sheet-slide-in" "action-sheet-md-slide-in" "action-sheet-wp-slide-in"
actionSheetLeave "action-sheet-slide-out" "action-sheet-md-slide-out" "action-sheet-wp-slide-out"
alertEnter "alert-pop-in" "alert-md-pop-in" "alert-wp-pop-in"
alertLeave "alert-pop-out" "alert-md-pop-out" "alert-wp-pop-out"
backButtonText "Back" "" ""
backButtonIcon "ios-arrow-back" "md-arrow-back" "ios-arrow-back"
iconMode "ios" "md" "ios"
loadingEnter "loading-pop-in" "loading-md-pop-in" "loading-wp-pop-in"
loadingLeave "loading-pop-out" "loading-md-pop-out" "loading-wp-pop-out"
menuType "reveal" "overlay" "overlay"
modalEnter "modal-slide-in" "modal-md-slide-in" "modal-md-slide-in"
modalLeave "modal-slide-out" "modal-md-slide-out" "modal-md-slide-out"
pageTransition "ios-transition" "md-transition" "wp-transition"
pageTransitionDelay 16 96 96
pickerEnter "picker-slide-in" "picker-slide-in" "picker-slide-in"
pickerLeave "picker-slide-out" "picker-slide-out" "picker-slide-out"
popoverEnter "popover-pop-in" "popover-md-pop-in" "popover-md-pop-in"
popoverLeave "popover-pop-out" "popover-md-pop-out" "popover-md-pop-out"
spinner "ios" "crescent" "circles"
tabsHighligh false false false
tabsLayout "icon-top" "icon-top" "icon-top"
tabsPlacement "bottom" "bottom" "top"
tabsHideOnSubPages false false true
toastEnter "toast-slide-in" "toast-md-slide-in" "toast-wp-slide-in"
toastLeave "toast-slide-out" "toast-md-slide-out" "toast-wp-slide-out"

覆写平台样式,如下:

.md .button {
text-transform: capitalize;
}

或简写为:

.button-md {
text-transform: capitalize;
}

4. 覆写Ionic Sass变量

详见Ionic Docs

5. RTL支持

$app-direction: multi // Both RTL and LTR
$app-direction: rtl // RTL only
$app-direction: ltr // LTR only

默认 LTR

详见Ionic Docs

如有不当之处,请予指正,谢谢~

Ionic3学习笔记(二)主题化的更多相关文章

  1. Vue.js官方文档学习笔记(二)组件化应用的构建

    组件化应用的构建 组件化应用允许我们使用小型.独立和通常可复用的组件构建大型应用. Vue注册组件 Vue.component('todo-item',{template:'<li>这是个 ...

  2. amazeui学习笔记二(进阶开发5)--Web 组件开发规范Rules

    amazeui学习笔记二(进阶开发5)--Web 组件开发规范Rules 一.总结 1.见名知意:见那些class名字知意,见函数名知意,见文件名知意 例如(HISTORY.md Web 组件更新历史 ...

  3. amazeui学习笔记二(进阶开发3)--HTML/CSS规范Rules

    amazeui学习笔记二(进阶开发3)--HTML/CSS规范Rules 一.总结 1.am:以 am 为命名空间 2.模块状态: {命名空间}-{模块名}-{状态描述} 3.子模块: {命名空间}- ...

  4. [Firefly引擎][学习笔记二][已完结]卡牌游戏开发模型的设计

    源地址:http://bbs.9miao.com/thread-44603-1-1.html 在此补充一下Socket的验证机制:socket登陆验证.会采用session会话超时的机制做心跳接口验证 ...

  5. Go语言学习笔记二: 变量

    Go语言学习笔记二: 变量 今天又学了一招如何查看go的版本的命令:go version.另外上一个笔记中的代码还可以使用go run hello.go来运行,只是这种方式不会生成exe文件. 定义变 ...

  6. amazeui学习笔记二(进阶开发4)--JavaScript规范Rules

    amazeui学习笔记二(进阶开发4)--JavaScript规范Rules 一.总结 1.注释规范总原则: As short as possible(如无必要,勿增注释):尽量提高代码本身的清晰性. ...

  7. amazeui学习笔记二(进阶开发2)--Web组件简介Web Component

    amazeui学习笔记二(进阶开发2)--Web组件简介Web Component 一.总结 1.amaze ui:amaze ui是一个web 组件, 由模板(hbs).样式(LESS).交互(JS ...

  8. 微信小程序学习笔记二 数据绑定 + 事件绑定

    微信小程序学习笔记二 1. 小程序特点概述 没有DOM 组件化开发: 具备特定功能效果的代码集合 体积小, 单个压缩包体积不能大于2M, 否则无法上线 小程序的四个重要的文件 *js *.wxml - ...

  9. MongoDB学习笔记二- Mongoose

    MongoDB学习笔记二 Mongoose Mongoose 简介 之前我们都是通过shell来完成对数据库的各种操作, 在开发中大部分时候我们都需要通过程序来完成对数据库的操作 而Mongoose就 ...

  10. WPF的Binding学习笔记(二)

    原文: http://www.cnblogs.com/pasoraku/archive/2012/10/25/2738428.htmlWPF的Binding学习笔记(二) 上次学了点点Binding的 ...

随机推荐

  1. 七字真言解读TCP三次握手

    三次握手所谓的"三次握手"即对每次发送的数据量是怎样跟踪进行协商使的发送和接收同步,根据所接收到的数据量而确定的数据确认数及数据发送.接收完毕后何时撤消联系,并建立虚连接. 一.七 ...

  2. Python闭包及其作用域

    Python闭包及其作用域 关于Python作用域的知识在python作用域有相应的笔记,这个笔记是关于Python闭包及其作用域的详细的笔记 如果在一个内部函数里,对一个外部作用域(但不是全局作用域 ...

  3. poj 2723 二分+2-sat判定

    题意:给出n对钥匙,每对钥匙只能选其中一个,在给出每层门需要的两个钥匙,只要一个钥匙就能开门,问最多能到哪层. 思路:了解了2-SAT判定的问题之后主要就是建图的问题了,这里建图就是对于2*n个钥匙, ...

  4. error: The requested URL returned error: 401 Unauthorized while accessing

    我遇到的其中一个问题. 问题描述: 在git push -u origin master是,提示“error: The requested URL returned error: 401 Unauth ...

  5. 电商Banner设计背后的12个人性的秘密

  6. 201521123056《Java程序设计》 第2周学习总结

    1. 本周学习总结 String类: 不可变字符串型: 粗略介绍了枚举类型: 完全限定类名: 泛型数组列表的应用: 2. 书面作业 Q1.使用Eclipse关联jdk源代码,并查看String对象的源 ...

  7. Junit4学习(一)新建Junit4工程

    一,学习Junit4,学以致用 二,熟悉编写流程 工具:Eclipse,Junit包,hamcrest.core包 1,打开Eclipse开发工具,新建工程:file->Java Project ...

  8. CustomDialog——一个多功能、通用、可自定义的Dialog

    CustomDialog--一个多功能.通用.可自定义的Dialog  依赖 compile 'com.github.SiberiaDante:CustomDialog:v1.0.1'  说明[Cus ...

  9. Spring第二篇【Core模块之快速入门、bean创建细节、创建对象】

    前言 上篇Spring博文主要引出了为啥我们需要使用Spring框架,以及大致了解了Spring是分为六大模块的-.本博文主要讲解Spring的core模块! 搭建配置环境 引入jar包 本博文主要是 ...

  10. mysql数据库-中文乱码问题解决方案

    来自:http://www.2cto.com/database/201108/101151.html MySQL会出现中文乱码的原因不外乎下列几点: .server本身设定问题,例如还停留在latin ...