mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
refactor(sass): individual sass files import globals
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Action Sheet
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// iOS Action Sheet
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// Material Design Action Sheet
|
||||
// --------------------------------------------------
|
||||
@@ -79,4 +80,3 @@ ion-action-sheet button {
|
||||
width: auto;
|
||||
border: none;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// iOS App
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// Material Design App
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Z-Index
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Typography
|
||||
// -------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Badge
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Clear Button
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// FABulous Buttons (Floating Action Button from material)
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Button Icons
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Outline Button
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Button Sizes
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Button Variables
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
button {
|
||||
&[block] {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// Material Design Button
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Card
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// iOS Card
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// Material Design Card
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Checkbox
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// iOS Checkbox Structure
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// Material Design Checkbox
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// iOS Content
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// Material Design Content Padding
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
/**
|
||||
* Grid
|
||||
* --------------------------------------------------
|
||||
* Using flexbox for the grid, inspired by Philip Walton:
|
||||
* http://philipwalton.github.io/solved-by-flexbox/demos/grids/
|
||||
* By default each .col within a .row will evenly take up
|
||||
* available width, and the height of each .col with take
|
||||
* up the height of the tallest .col in the same .row.
|
||||
*/
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Grid
|
||||
// --------------------------------------------------
|
||||
// Using flexbox for the grid, inspired by Philip Walton:
|
||||
// http://philipwalton.github.io/solved-by-flexbox/demos/grids/
|
||||
// By default each .col within a .row will evenly take up
|
||||
// available width, and the height of each .col with take
|
||||
// up the height of the tallest .col in the same .row.
|
||||
|
||||
|
||||
$grid-padding-width: 10px !default;
|
||||
$grid-responsive-sm-break: 567px !default; // smaller than landscape phone
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Icon
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// iOS Icon
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Item Media
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
/**
|
||||
* The hidden right-side buttons that can be exposed under a list item
|
||||
* with dragging.
|
||||
*/
|
||||
|
||||
// The hidden right-side buttons that can be exposed under a list item with dragging.
|
||||
ion-item-sliding {
|
||||
display: block;
|
||||
position: relative;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Item
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// iOS Item
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// Material Design Item
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// List
|
||||
// --------------------------------------------------
|
||||
@@ -20,7 +21,7 @@
|
||||
.list[inset] {
|
||||
overflow: hidden;
|
||||
transform: translateZ(0);
|
||||
|
||||
|
||||
ion-header {
|
||||
background-color: $list-background-color;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// iOS List
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// Material Design List
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Menu Reveal
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Menu
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Modals
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// iOS Navbar
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// Material Design Navbar
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Navbar
|
||||
// --------------------------------------------------
|
||||
@@ -8,7 +9,7 @@ ion-navbar.toolbar {
|
||||
}
|
||||
|
||||
.back-button {
|
||||
order: map-get($toolbar-order, backButton);
|
||||
order: map-get($toolbar-order, backButton);
|
||||
|
||||
display: none;
|
||||
&.show-back-button {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// iOS Popups
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// Material Design Popups
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Popups
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// iOS Radio
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// Material Design Radio
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Radio
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
ion-scroll {
|
||||
position: relative;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// iOS Search Bar
|
||||
// --------------------------------------------------
|
||||
@@ -137,5 +138,5 @@ ion-searchbar.left-align {
|
||||
color: $color-value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// Material Design Search Bar
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Search Bar
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// iOS Segment
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// iOS Segment
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Segment
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
ion-swipe-slides {
|
||||
display: block;
|
||||
width: 100%;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// iOS Switch
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// Material Design Switch
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Switch
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// iOS Tabs
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// Material Design Tabs
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Tabs
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Material Design Ripple Effect
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Label
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// iOS Text Input
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// Material Design Text Input
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Text Input
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// iOS Toolbar
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../../ionic.globals";
|
||||
|
||||
// Material Design Toolbar
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../../ionic.globals";
|
||||
|
||||
// Toolbar
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
|
||||
// Theme
|
||||
@import "themes/default";
|
||||
|
||||
|
||||
// Globals
|
||||
// Core App
|
||||
@import
|
||||
"util/mixins",
|
||||
"components/app/normalize",
|
||||
"components/app/structure",
|
||||
"components/app/typography",
|
||||
@@ -50,6 +45,7 @@
|
||||
|
||||
|
||||
// Ionicons
|
||||
// soon to be replaced with SVGs
|
||||
$font-path: "../fonts" !default;
|
||||
$ionicons: true !default;
|
||||
@if ($ionicons) {
|
||||
|
||||
11
ionic/ionic.globals.scss
Normal file
11
ionic/ionic.globals.scss
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
// Global Theme
|
||||
@import "themes/default";
|
||||
|
||||
|
||||
// Global Functions
|
||||
@import "util/functions";
|
||||
|
||||
|
||||
// Global Mixins
|
||||
@import "util/mixins";
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"ecmaFeatures": {
|
||||
"blockBindings": true,
|
||||
"arrowFunctions": true,
|
||||
"classes": true,
|
||||
"forOf": true,
|
||||
"modules": true,
|
||||
},
|
||||
"rules": {
|
||||
"semi": 2
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../ionic.globals";
|
||||
|
||||
// iOS Cordova
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -18,7 +18,7 @@ $background-color: #222 !default;
|
||||
|
||||
$list-text-color: $text-color !default;
|
||||
$list-background-color: $background-color !default;
|
||||
$list-border-color: #666 !default;
|
||||
$list-border-color: #666 !default;
|
||||
|
||||
$link-color: map-get($colors, primary) !default;
|
||||
|
||||
|
||||
62
ionic/util/functions.scss
Normal file
62
ionic/util/functions.scss
Normal file
@@ -0,0 +1,62 @@
|
||||
|
||||
// Color Functions
|
||||
// --------------------------------------------------
|
||||
|
||||
@function inverse($color-value) {
|
||||
@if (lightness($color-value) > 70) {
|
||||
@return #000;
|
||||
}
|
||||
@else {
|
||||
@return #fff;
|
||||
}
|
||||
}
|
||||
|
||||
@function darken-or-lighten($color-value, $amount:8%) {
|
||||
// lightness is a percent value, 0% darkest, 100% lightest
|
||||
$lightness-percent: lightness($color-value);
|
||||
|
||||
|
||||
@if ($lightness-percent > 80) {
|
||||
// really light foreground color, so really darken it up
|
||||
@return darken($color-value, ($amount * 2));
|
||||
}
|
||||
|
||||
@if ($lightness-percent < 35) {
|
||||
// dark foreground color, so light it up
|
||||
@return lighten($color-value, $amount * 2);
|
||||
}
|
||||
|
||||
// default to darken
|
||||
@return darken($color-value, $amount);
|
||||
}
|
||||
|
||||
@function color($color-name) {
|
||||
@return map-get($colors, $color-name);
|
||||
}
|
||||
|
||||
@function auxiliary-colors() {
|
||||
// get a map of all the colors, except "primary"
|
||||
@return map-remove($colors, primary);
|
||||
}
|
||||
|
||||
|
||||
// String Replace Function
|
||||
// --------------------------------------------------
|
||||
|
||||
@function str-replace($string, $search, $replace: '') {
|
||||
$index: str-index($string, $search);
|
||||
|
||||
@if $index {
|
||||
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
|
||||
}
|
||||
|
||||
@return $string;
|
||||
}
|
||||
|
||||
|
||||
// URL Encode Function
|
||||
// --------------------------------------------------
|
||||
|
||||
@function url-encode($val) {
|
||||
@return str-replace($val, ' ', '%20');
|
||||
}
|
||||
@@ -1,46 +1,4 @@
|
||||
|
||||
// Color Functions
|
||||
// --------------------------------------------------
|
||||
|
||||
@function inverse($color-value) {
|
||||
@if (lightness($color-value) > 70) {
|
||||
@return #000;
|
||||
}
|
||||
@else {
|
||||
@return #fff;
|
||||
}
|
||||
}
|
||||
|
||||
@function darken-or-lighten($color-value, $amount:8%) {
|
||||
// lightness is a percent value, 0% darkest, 100% lightest
|
||||
$lightness-percent: lightness($color-value);
|
||||
|
||||
|
||||
@if ($lightness-percent > 80) {
|
||||
// really light foreground color, so really darken it up
|
||||
@return darken($color-value, ($amount * 2));
|
||||
}
|
||||
|
||||
@if ($lightness-percent < 35) {
|
||||
// dark foreground color, so light it up
|
||||
@return lighten($color-value, $amount * 2);
|
||||
}
|
||||
|
||||
// default to darken
|
||||
@return darken($color-value, $amount);
|
||||
}
|
||||
|
||||
@function color($color-name) {
|
||||
@return map-get($colors, $color-name);
|
||||
}
|
||||
|
||||
@function auxiliary-colors() {
|
||||
// get a map of all the colors, except "primary"
|
||||
@return map-remove($colors, primary);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Appearance
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -50,19 +8,15 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
// User Select None
|
||||
// Calc
|
||||
// --------------------------------------------------
|
||||
|
||||
@mixin user-select-none() {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
@mixin calc($property, $expression) {
|
||||
#{$property}: -webkit-calc(#{$expression});
|
||||
#{$property}: calc(#{$expression});
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Input Placeholder
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -81,31 +35,6 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
// String Replace Function
|
||||
// --------------------------------------------------
|
||||
|
||||
@function str-replace($string, $search, $replace: '') {
|
||||
$index: str-index($string, $search);
|
||||
|
||||
@if $index {
|
||||
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
|
||||
}
|
||||
|
||||
@return $string;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// URL Encode Function
|
||||
// --------------------------------------------------
|
||||
|
||||
@function url-encode($val) {
|
||||
@return str-replace($val, ' ', '%20');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// SVG Background Image Mixin
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -115,11 +44,12 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
// calc()
|
||||
// User Select None
|
||||
// --------------------------------------------------
|
||||
|
||||
@mixin calc($property, $expression) {
|
||||
#{$property}: -webkit-calc(#{$expression});
|
||||
#{$property}: calc(#{$expression});
|
||||
@mixin user-select-none() {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
@import "../ionic.globals";
|
||||
|
||||
.align-left {
|
||||
text-align: left;
|
||||
|
||||
Reference in New Issue
Block a user