Summary Files Commits Branches @commit @diff @stats
path: root / src
diff options
context:
space:
mode:
Commit4a784e66ed171336e9b9b281e02c2fdff2bde8cd (patch)
Author
 Yan Zhu <picturepan2@hotmail.com>
2017-12-07 02:48:23 -0600
Committer
 GitHub <noreply@github.com>
2017-12-07 02:48:23 -0600
Files5423cf80ab4327496c77f04de08922f59056f863 /src
Spectre-Dark-Gruvbox-4a784e66ed171336e9b9b281e02c2fdff2bde8cd.tar
Spectre-Dark-Gruvbox-4a784e66ed171336e9b9b281e02c2fdff2bde8cd.tar.gz
Spectre-Dark-Gruvbox-4a784e66ed171336e9b9b281e02c2fdff2bde8cd.zip
Parent57febed350bfba13b84763eb882d93e1817c9d78 (diff)
Parent357c8601a9346757bd76842cd68b3782db09bbc5 (diff)
Merge pull request #354 from picturepan2/0.5.0 v0.5.0
0.5.0
15 files changed, 238 insertions, 216 deletions
-rw-r--r--src/_forms.scss25
-rw-r--r--src/_mixins.scss196
-rwxr-xr-xsrc/_navbar.scss2
-rw-r--r--src/_off-canvas.scss40
-rw-r--r--src/_variables.scss2
-rw-r--r--src/mixins/_avatar.scss6
-rw-r--r--src/mixins/_button.scss51
-rw-r--r--src/mixins/_clearfix.scss8
-rw-r--r--src/mixins/_color.scss24
-rw-r--r--src/mixins/_label.scss11
-rw-r--r--src/mixins/_position.scss65
-rw-r--r--src/mixins/_shadow.scss9
-rw-r--r--src/mixins/_text.scss6
-rw-r--r--src/mixins/_toast.scss5
-rw-r--r--src/mixins/_transition.scss4
diff --git a/src/_forms.scss b/src/_forms.scss
index 0c7e228..acd34ad 100644
--- a/src/_forms.scss
+++ b/src/_forms.scss
@@ -22,10 +22,12 @@ legend {
padding: $control-padding-y + $border-width 0;
&.label-sm {
+ font-size: $font-size-sm;
padding: $control-padding-y-sm + $border-width 0;
}
&.label-lg {
+ font-size: $font-size-lg;
padding: $control-padding-y-lg + $border-width 0;
}
}
@@ -192,7 +194,9 @@ textarea.form-input {
.form-switch {
display: inline-block;
line-height: $line-height;
- padding: (($control-size-sm - $line-height) / 2) ($control-icon-size + $control-padding-x);
+ margin: ($control-size - $control-size-sm) / 2 0;
+ min-height: 1.2rem;
+ padding: (($control-size-sm - $line-height) / 2) $control-padding-x (($control-size-sm - $line-height) / 2) ($control-icon-size + $control-padding-x);
position: relative;
input {
@@ -219,6 +223,17 @@ textarea.form-input {
display: inline-block;
position: absolute;
}
+
+ // Input checkbox, radio and switch sizes
+ &.input-sm {
+ font-size: $font-size-sm;
+ margin: 0;
+ }
+
+ &.input-lg {
+ font-size: $font-size-lg;
+ margin: ($control-size-lg - $control-size-sm) / 2 0;
+ }
}
.form-checkbox,
@@ -349,11 +364,13 @@ textarea.form-input {
border-radius: $border-radius;
line-height: $line-height;
padding: $control-padding-y $control-padding-x;
+ white-space: nowrap;
&.addon-sm {
font-size: $font-size-sm;
padding: $control-padding-y-sm $control-padding-x-sm;
}
+
&.addon-lg {
font-size: $font-size-lg;
padding: $control-padding-y-lg $control-padding-x-lg;
@@ -505,10 +522,4 @@ input {
.form-group {
display: flex;
}
-
- .form-checkbox,
- .form-radio,
- .form-switch {
- margin: ($control-size - $control-size-sm) / 2 0;
- }
}
diff --git a/src/_mixins.scss b/src/_mixins.scss
index 18c4d47..54bed34 100644
--- a/src/_mixins.scss
+++ b/src/_mixins.scss
@@ -1,187 +1,11 @@
// Mixins
-// Avatar mixin
-@mixin avatar-base($size: $unit-8) {
- font-size: $size / 2;
- height: $size;
- width: $size;
-}
-
-// Background color utility mixin
-@mixin bg-color-variant($name: ".bg-primary", $color: $primary-color) {
- #{$name} {
- background: $color;
-
- @if (lightness($color) < 60) {
- color: $light-color;
- }
- }
-}
-
-// Button variant mixin
-@mixin button-variant($color: $primary-color) {
- background: $color;
- border-color: darken($color, 3%);
- color: $light-color;
- &:focus {
- @include control-shadow($color);
- }
- &:focus,
- &:hover {
- background: darken($color, 2%);
- border-color: darken($color, 5%);
- color: $light-color;
- }
- &:active,
- &.active {
- background: darken($color, 7%);
- border-color: darken($color, 10%);
- color: $light-color;
- }
- &.loading {
- @extend .btn-primary.loading;
- }
-}
-
-@mixin button-outline-variant($color: $primary-color) {
- background: $light-color;
- border-color: $color;
- color: $color;
- &:focus {
- @include control-shadow($color);
- }
- &:focus,
- &:hover {
- background: lighten($color, 50%);
- border-color: darken($color, 2%);
- color: $color;
- }
- &:active,
- &.active {
- background: $color;
- border-color: darken($color, 5%);
- color: $light-color;
- }
- &.loading {
- &::after {
- border-bottom-color: $color;
- border-left-color: $color;
- }
- }
-}
-
-// Clearfix mixin
-@mixin clearfix() {
- &::after {
- clear: both;
- content: "";
- display: table;
- }
-}
-
-// Component focus shadow
-@mixin control-shadow($color: $primary-color) {
- box-shadow: 0 0 0 .1rem rgba($color, .2);
-}
-
-// Component transition
-@mixin control-transition() {
- transition: all .2s ease;
-}
-
-// Label base style
-@mixin label-base() {
- border-radius: $border-radius;
- line-height: 1.2;
- padding: .1rem .15rem;
-}
-
-@mixin label-variant($color: $light-color, $bg-color: $primary-color) {
- background: $bg-color;
- color: $color;
-}
-
-// Margin utility mixin
-@mixin margin-variant($id: 1, $size: $unit-1) {
- .m-#{$id} {
- margin: $size;
- }
- .mb-#{$id} {
- margin-bottom: $size;
- }
- .ml-#{$id} {
- margin-left: $size;
- }
- .mr-#{$id} {
- margin-right: $size;
- }
- .mt-#{$id} {
- margin-top: $size;
- }
- .mx-#{$id} {
- margin-left: $size;
- margin-right: $size;
- }
- .my-#{$id} {
- margin-bottom: $size;
- margin-top: $size;
- }
-}
-
-// Padding utility mixin
-@mixin padding-variant($id: 1, $size: $unit-1) {
- .p-#{$id} {
- padding: $size;
- }
- .pb-#{$id} {
- padding-bottom: $size;
- }
- .pl-#{$id} {
- padding-left: $size;
- }
- .pr-#{$id} {
- padding-right: $size;
- }
- .pt-#{$id} {
- padding-top: $size;
- }
- .px-#{$id} {
- padding-left: $size;
- padding-right: $size;
- }
- .py-#{$id} {
- padding-bottom: $size;
- padding-top: $size;
- }
-}
-
-// Shadow mixin
-@mixin shadow-variant($offset) {
- box-shadow: 0 $offset ($offset + .05rem) * 2 rgba($dark-color, .3);
-}
-
-// Text color utility mixin
-@mixin text-color-variant($name: ".text-primary", $color: $primary-color) {
- #{$name} {
- color: $color;
- }
-
- a#{$name} {
- &:focus,
- &:hover {
- color: darken($color, 5%);
- }
- }
-}
-
-// Text Ellipsis
-@mixin text-ellipsis() {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
-// Toast variant mixin
-@mixin toast-variant($color: $dark-color) {
- background: rgba($color, .9);
- border-color: $color;
-}
+@import "mixins/avatar";
+@import "mixins/button";
+@import "mixins/clearfix";
+@import "mixins/color";
+@import "mixins/label";
+@import "mixins/position";
+@import "mixins/shadow";
+@import "mixins/text";
+@import "mixins/toast";
+@import "mixins/transition";
diff --git a/src/_navbar.scss b/src/_navbar.scss
index a90b6e6..57585ab 100755
--- a/src/_navbar.scss
+++ b/src/_navbar.scss
@@ -10,7 +10,7 @@
display: flex;
flex: 1 0 0;
- &:last-child {
+ &:not(:first-child):last-child {
justify-content: flex-end;
}
}
diff --git a/src/_off-canvas.scss b/src/_off-canvas.scss
index 061dc26..a85d9fe 100644
--- a/src/_off-canvas.scss
+++ b/src/_off-canvas.scss
@@ -8,6 +8,15 @@ $off-canvas-breakpoint: $size-lg !default;
position: relative;
width: 100%;
+ .off-canvas-toggle {
+ display: block;
+ left: $layout-spacing;
+ position: absolute;
+ top: $layout-spacing;
+ transition: none;
+ z-index: $zindex-0;
+ }
+
.off-canvas-sidebar {
background: $bg-color;
bottom: 0;
@@ -53,32 +62,21 @@ $off-canvas-breakpoint: $size-lg !default;
z-index: $zindex-2;
}
}
-
- .off-canvas-toggle {
- display: block;
- left: $layout-spacing;
- position: absolute;
- top: $layout-spacing;
- transition: none;
- z-index: $zindex-0;
- }
}
// Responsive layout
@media (min-width: $off-canvas-breakpoint) {
.off-canvas {
- .off-canvas-sidebar {
- flex: 0 0 auto;
- position: relative;
- transform: none;
- }
-
- .off-canvas-content {
- padding-left: $layout-spacing-lg;
- }
-
- .off-canvas-toggle {
- display: none;
+ &.off-canvas-sidebar-show {
+ .off-canvas-toggle {
+ display: none;
+ }
+
+ .off-canvas-sidebar {
+ flex: 0 0 auto;
+ position: relative;
+ transform: none;
+ }
}
}
}
diff --git a/src/_variables.scss b/src/_variables.scss
index 7859215..1e328cc 100644
--- a/src/_variables.scss
+++ b/src/_variables.scss
@@ -1,5 +1,5 @@
// Core variables
-$version: "0.4.7";
+$version: "0.5.0";
// Core colors
$primary-color: #5755d9 !default;
diff --git a/src/mixins/_avatar.scss b/src/mixins/_avatar.scss
new file mode 100644
index 0000000..14617ad
--- /dev/null
+++ b/src/mixins/_avatar.scss
@@ -0,0 +1,6 @@
+// Avatar mixin
+@mixin avatar-base($size: $unit-8) {
+ font-size: $size / 2;
+ height: $size;
+ width: $size;
+}
diff --git a/src/mixins/_button.scss b/src/mixins/_button.scss
new file mode 100644
index 0000000..338e8e3
--- /dev/null
+++ b/src/mixins/_button.scss
@@ -0,0 +1,51 @@
+// Button variant mixin
+@mixin button-variant($color: $primary-color) {
+ background: $color;
+ border-color: darken($color, 3%);
+ color: $light-color;
+ &:focus {
+ @include control-shadow($color);
+ }
+ &:focus,
+ &:hover {
+ background: darken($color, 2%);
+ border-color: darken($color, 5%);
+ color: $light-color;
+ }
+ &:active,
+ &.active {
+ background: darken($color, 7%);
+ border-color: darken($color, 10%);
+ color: $light-color;
+ }
+ &.loading {
+ @extend .btn-primary.loading;
+ }
+}
+
+@mixin button-outline-variant($color: $primary-color) {
+ background: $light-color;
+ border-color: $color;
+ color: $color;
+ &:focus {
+ @include control-shadow($color);
+ }
+ &:focus,
+ &:hover {
+ background: lighten($color, 50%);
+ border-color: darken($color, 2%);
+ color: $color;
+ }
+ &:active,
+ &.active {
+ background: $color;
+ border-color: darken($color, 5%);
+ color: $light-color;
+ }
+ &.loading {
+ &::after {
+ border-bottom-color: $color;
+ border-left-color: $color;
+ }
+ }
+}
diff --git a/src/mixins/_clearfix.scss b/src/mixins/_clearfix.scss
new file mode 100644
index 0000000..db6895f
--- /dev/null
+++ b/src/mixins/_clearfix.scss
@@ -0,0 +1,8 @@
+// Clearfix mixin
+@mixin clearfix() {
+ &::after {
+ clear: both;
+ content: "";
+ display: table;
+ }
+}
diff --git a/src/mixins/_color.scss b/src/mixins/_color.scss
new file mode 100644
index 0000000..f2e2e5c
--- /dev/null
+++ b/src/mixins/_color.scss
@@ -0,0 +1,24 @@
+// Background color utility mixin
+@mixin bg-color-variant($name: ".bg-primary", $color: $primary-color) {
+ #{$name} {
+ background: $color;
+
+ @if (lightness($color) < 60) {
+ color: $light-color;
+ }
+ }
+}
+
+// Text color utility mixin
+@mixin text-color-variant($name: ".text-primary", $color: $primary-color) {
+ #{$name} {
+ color: $color;
+ }
+
+ a#{$name} {
+ &:focus,
+ &:hover {
+ color: darken($color, 5%);
+ }
+ }
+}
diff --git a/src/mixins/_label.scss b/src/mixins/_label.scss
new file mode 100644
index 0000000..fad20c1
--- /dev/null
+++ b/src/mixins/_label.scss
@@ -0,0 +1,11 @@
+// Label base style
+@mixin label-base() {
+ border-radius: $border-radius;
+ line-height: 1.2;
+ padding: .1rem .15rem;
+}
+
+@mixin label-variant($color: $light-color, $bg-color: $primary-color) {
+ background: $bg-color;
+ color: $color;
+}
diff --git a/src/mixins/_position.scss b/src/mixins/_position.scss
new file mode 100644
index 0000000..0943469
--- /dev/null
+++ b/src/mixins/_position.scss
@@ -0,0 +1,65 @@
+// Margin utility mixin
+@mixin margin-variant($id: 1, $size: $unit-1) {
+ .m-#{$id} {
+ margin: $size;
+ }
+
+ .mb-#{$id} {
+ margin-bottom: $size;
+ }
+
+ .ml-#{$id} {
+ margin-left: $size;
+ }
+
+ .mr-#{$id} {
+ margin-right: $size;
+ }
+
+ .mt-#{$id} {
+ margin-top: $size;
+ }
+
+ .mx-#{$id} {
+ margin-left: $size;
+ margin-right: $size;
+ }
+
+ .my-#{$id} {
+ margin-bottom: $size;
+ margin-top: $size;
+ }
+}
+
+// Padding utility mixin
+@mixin padding-variant($id: 1, $size: $unit-1) {
+ .p-#{$id} {
+ padding: $size;
+ }
+
+ .pb-#{$id} {
+ padding-bottom: $size;
+ }
+
+ .pl-#{$id} {
+ padding-left: $size;
+ }
+
+ .pr-#{$id} {
+ padding-right: $size;
+ }
+
+ .pt-#{$id} {
+ padding-top: $size;
+ }
+
+ .px-#{$id} {
+ padding-left: $size;
+ padding-right: $size;
+ }
+
+ .py-#{$id} {
+ padding-bottom: $size;
+ padding-top: $size;
+ }
+}
diff --git a/src/mixins/_shadow.scss b/src/mixins/_shadow.scss
new file mode 100644
index 0000000..7984449
--- /dev/null
+++ b/src/mixins/_shadow.scss
@@ -0,0 +1,9 @@
+// Component focus shadow
+@mixin control-shadow($color: $primary-color) {
+ box-shadow: 0 0 0 .1rem rgba($color, .2);
+}
+
+// Shadow mixin
+@mixin shadow-variant($offset) {
+ box-shadow: 0 $offset ($offset + .05rem) * 2 rgba($dark-color, .3);
+}
diff --git a/src/mixins/_text.scss b/src/mixins/_text.scss
new file mode 100644
index 0000000..97dc99d
--- /dev/null
+++ b/src/mixins/_text.scss
@@ -0,0 +1,6 @@
+// Text Ellipsis
+@mixin text-ellipsis() {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
diff --git a/src/mixins/_toast.scss b/src/mixins/_toast.scss
new file mode 100644
index 0000000..a7d3bbf
--- /dev/null
+++ b/src/mixins/_toast.scss
@@ -0,0 +1,5 @@
+// Toast variant mixin
+@mixin toast-variant($color: $dark-color) {
+ background: rgba($color, .9);
+ border-color: $color;
+}
diff --git a/src/mixins/_transition.scss b/src/mixins/_transition.scss
new file mode 100644
index 0000000..0b7497b
--- /dev/null
+++ b/src/mixins/_transition.scss
@@ -0,0 +1,4 @@
+// Component transition
+@mixin control-transition() {
+ transition: all .2s ease;
+}