Summary Files Commits Branches @commit @diff @stats
path: root / src
diff options
context:
space:
mode:
Commit706c3577c517631e8460b58afe975e6f6abe2c79 (patch)
Author
 Yan Zhu <picturepan2@hotmail.com>
2017-08-03 13:27:26 +0800
Committer
 Yan Zhu <picturepan2@hotmail.com>
2017-08-03 13:27:26 +0800
Files4437d242bb3a7023eff745562f05adc44803c10b /src
Spectre-Dark-Gruvbox-706c3577c517631e8460b58afe975e6f6abe2c79.tar
Spectre-Dark-Gruvbox-706c3577c517631e8460b58afe975e6f6abe2c79.tar.gz
Spectre-Dark-Gruvbox-706c3577c517631e8460b58afe975e6f6abe2c79.zip
Parentba51cc1212b14201f9bddeab10e3de7c8f4cd017 (diff)
Add form-checkbox, radio and switch validation styles
4 files changed, 72 insertions, 42 deletions
-rw-r--r--src/forms.less107
-rw-r--r--src/modals.less2
-rw-r--r--src/pagination.less1
-rw-r--r--src/tables.less4
diff --git a/src/forms.less b/src/forms.less
index dd0d043..742fb8b 100644
--- a/src/forms.less
+++ b/src/forms.less
@@ -5,6 +5,16 @@
}
}
+fieldset {
+ margin-bottom: @layout-spacing-lg;
+}
+
+legend {
+ font-size: @font-size-lg;
+ font-weight: 500;
+ margin-bottom: @layout-spacing-lg;
+}
+
// Form element: Label
.form-label {
display: block;
@@ -36,6 +46,7 @@
outline: none;
padding: @control-padding-v @control-padding-h;
position: relative;
+
width: 100%;
&:focus {
border-color: @primary-color;
@@ -78,6 +89,7 @@
// Form element: Input hint
.form-input-hint {
color: @gray-color;
+ font-size: @font-size-sm;
margin-top: @unit-1;
.has-success &,
@@ -136,42 +148,6 @@
}
}
-// Form validation states
-.form-input,
-.form-select {
- .has-success &,
- &.is-success {
- border-color: @control-color-success;
- &:focus {
- .control-shadow(@control-color-success);
- }
- }
-
- .has-error &,
- &.is-error {
- border-color: @control-color-error;
- &:focus {
- .control-shadow(@control-color-error);
- }
- }
-}
-
-// validation based on :placeholder-shown (Edge doesn't support it yet)
-.form-input {
- &:not(:placeholder-shown) {
- &:invalid {
- border-color: @control-color-error;
- &:focus {
- .control-shadow(@control-color-error);
- }
-
- & + .form-input-hint {
- color: @control-color-error;
- }
- }
- }
-}
-
// Form Icons
.has-icon-left,
.has-icon-right {
@@ -417,6 +393,65 @@
}
}
+// Form validation states
+.form-input,
+.form-select {
+ .has-success &,
+ &.is-success {
+ border-color: @control-color-success;
+ &:focus {
+ .control-shadow(@control-color-success);
+ }
+ }
+
+ .has-error &,
+ &.is-error {
+ border-color: @control-color-error;
+ &:focus {
+ .control-shadow(@control-color-error);
+ }
+ }
+}
+
+.form-checkbox,
+.form-radio,
+.form-switch {
+ .has-error &,
+ &.is-error {
+ .form-icon {
+ border-color: @control-color-error;
+ }
+
+ input {
+ &:checked + .form-icon {
+ background: @control-color-error;
+ border-color: @control-color-error;
+ }
+
+ &:focus + .form-icon {
+ border-color: @control-color-error;
+ .control-shadow(@control-color-error);
+ }
+ }
+ }
+}
+
+// validation based on :placeholder-shown (Edge doesn't support it yet)
+.form-input {
+ &:not(:placeholder-shown) {
+ &:invalid {
+ border-color: @control-color-error;
+ &:focus {
+ .control-shadow(@control-color-error);
+ }
+
+ & + .form-input-hint {
+ color: @control-color-error;
+ }
+ }
+ }
+}
+
// Form disabled and readonly
.form-input,
.form-select {
diff --git a/src/modals.less b/src/modals.less
index 60aa2b1..8ff16f5 100644
--- a/src/modals.less
+++ b/src/modals.less
@@ -19,7 +19,7 @@
z-index: @zindex-4;
.modal-overlay {
- background: fade(@dark-color, 50%);
+ background: fade(@bg-color, 75%);
bottom: 0;
cursor: default;
display: block;
diff --git a/src/pagination.less b/src/pagination.less
index a896e0e..e4e5c94 100644
--- a/src/pagination.less
+++ b/src/pagination.less
@@ -21,7 +21,6 @@
&:hover {
color: @primary-color;
}
- &[disabled],
&.disabled {
cursor: default;
opacity: .5;
diff --git a/src/tables.less b/src/tables.less
index bbe47e2..3ff0f47 100644
--- a/src/tables.less
+++ b/src/tables.less
@@ -39,8 +39,4 @@
border-bottom: @border-width solid @border-color;
padding: @unit-3 @unit-2;
}
-
- th {
- border-bottom-color: @gray-color-dark;
- }
}