Summary Files Commits Branches @commit @diff @stats
path: root / src
diff options
context:
space:
mode:
Commit008e4b89b4b888d22605fdb3126b19476b510b43 (patch)
Author
 Yan Zhu <picturepan2@hotmail.com>
2017-03-06 20:19:17 +0800
Committer
 Yan Zhu <picturepan2@hotmail.com>
2017-03-06 20:19:17 +0800
Filesb63f82131249f2c50325f1397df0d495de5a488d /src
Spectre-Dark-Gruvbox-008e4b89b4b888d22605fdb3126b19476b510b43.tar
Spectre-Dark-Gruvbox-008e4b89b4b888d22605fdb3126b19476b510b43.tar.gz
Spectre-Dark-Gruvbox-008e4b89b4b888d22605fdb3126b19476b510b43.zip
Parent19491023c17bce72fcaf2585e2b7e03c3c21dfb7 (diff)
Add Calendars experimental support
4 files changed, 143 insertions, 5 deletions
-rw-r--r--src/buttons.less2
-rw-r--r--src/calendars.less135
-rw-r--r--src/menus.less6
-rw-r--r--src/variables.less5
diff --git a/src/buttons.less b/src/buttons.less
index 72e8131..6ae9e5f 100644
--- a/src/buttons.less
+++ b/src/buttons.less
@@ -18,7 +18,7 @@
vertical-align: middle;
white-space: nowrap;
&:focus {
- background: @light-primary-color;
+ background: @light-secondary-color;
text-decoration: none;
}
&:hover {
diff --git a/src/calendars.less b/src/calendars.less
new file mode 100644
index 0000000..c94d674
--- /dev/null
+++ b/src/calendars.less
@@ -0,0 +1,135 @@
+// Calendars
+.calendar {
+ border: .1rem solid @border-color;
+ border-radius: @border-radius;
+ display: block;
+ text-align: center;
+
+ .calendar-nav {
+ align-content: space-between;
+ align-items: center;
+ background: @bg-color;
+ border-top-left-radius: @border-radius;
+ border-top-right-radius: @border-radius;
+ display: flex;
+ font-size: 2rem;
+ padding: 1rem;
+ }
+
+ .calendar-header,
+ .calendar-body {
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: center;
+ padding: 1rem 0;
+
+ .calendar-date {
+ flex: 0 0 14%;
+ }
+ }
+
+ .calendar-header {
+ border-bottom: .1rem solid @border-color;
+ color: @gray-color;
+ }
+
+ .calendar-body {
+ color: @dark-gray-color;
+
+ .calendar-date {
+ & {
+ border: 0;
+ padding: .5rem;
+
+ .date-item {
+ color: @dark-gray-color;
+ }
+ }
+
+ &.calendar-range {
+ position: relative;
+
+ .date-item {
+ &::before {
+ background: @secondary-color;
+ content: "";
+ height: 3.2rem;
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translateY(-50%);
+ width: 50%;
+ z-index: -9;
+ }
+ }
+
+ & + .calendar-range {
+ .date-item {
+ &::before {
+ left: 0;
+ width: 100%;
+ }
+ &.active {
+ &::before {
+ width: 50%;
+ }
+ }
+ }
+ }
+ }
+
+ &.prev-month,
+ &.next-month {
+ .date-item {
+ opacity: .25;
+ }
+ }
+ }
+
+ .date-item {
+ appearance: none;
+ background: transparent;
+ border: .1rem solid transparent;
+ border-radius: 50%;
+ .control-transition();
+ cursor: pointer;
+ display: inline-block;
+ height: 3.2rem;
+ line-height: 2rem;
+ padding: .5rem;
+ text-align: center;
+ text-decoration: none;
+ vertical-align: middle;
+ white-space: nowrap;
+ width: 3.2rem;
+
+ &:focus,
+ &:hover {
+ background: @light-secondary-color;
+ border-color: @dark-secondary-color;
+ color: @primary-color;
+ text-decoration: none;
+ }
+ &:active,
+ &.active {
+ background: @dark-primary-color;
+ border-color: darken(@dark-primary-color, 5%);
+ color: @light-color;
+ }
+ &.date-today {
+ background: @secondary-color;
+ color: @primary-color;
+ }
+
+ // Calendar badge support
+ &.badge {
+ &::after {
+ position: absolute;
+ top: .4rem;
+ right: .4rem;
+ transform: translate(50%, -50%);
+ }
+ }
+ }
+ }
+}
diff --git a/src/menus.less b/src/menus.less
index 1849a32..99e5194 100644
--- a/src/menus.less
+++ b/src/menus.less
@@ -28,12 +28,12 @@
text-decoration: none;
&:focus,
&:hover {
- color: @link-color;
+ color: @primary-color;
}
&:active,
&.active {
- background: @light-primary-color;
- color: @dark-link-color;
+ background: @light-secondary-color;
+ color: @primary-color;
}
}
}
diff --git a/src/variables.less b/src/variables.less
index 52da248..78ec0b6 100644
--- a/src/variables.less
+++ b/src/variables.less
@@ -22,7 +22,10 @@
// Core colors
@primary-color: #5764c6;
@dark-primary-color: darken(@primary-color, 5%);
-@light-primary-color: lighten(@primary-color, 42%);
+@light-primary-color: lighten(@primary-color, 2%);
+@secondary-color: lighten(@primary-color, 40%);
+@dark-secondary-color: darken(@secondary-color, 5%);
+@light-secondary-color: lighten(@secondary-color, 2%);
@dark-color: #333;
@dark-gray-color: #666;
@gray-color: #999;