summaryrefslogtreecommitdiffhomepage
path: root/themes/luci-theme-bootstrap
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2018-10-20 17:56:02 +0200
committerJo-Philipp Wich <jo@mein.io>2018-11-05 11:05:12 +0100
commit7c78218339ac914f097db79c343b07ea86c7313a (patch)
tree4607442d001a841964fbbedbb23a99bfbdfe7faa /themes/luci-theme-bootstrap
parentbd614de514a7dd43a25f432dc1a9f9f66e7eec2b (diff)
luci-base, themes: rework dynlist and dropdown widgets
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'themes/luci-theme-bootstrap')
-rw-r--r--themes/luci-theme-bootstrap/htdocs/luci-static/bootstrap/cascade.css54
1 files changed, 51 insertions, 3 deletions
diff --git a/themes/luci-theme-bootstrap/htdocs/luci-static/bootstrap/cascade.css b/themes/luci-theme-bootstrap/htdocs/luci-static/bootstrap/cascade.css
index 67e19e7d0..73e6c3bed 100644
--- a/themes/luci-theme-bootstrap/htdocs/luci-static/bootstrap/cascade.css
+++ b/themes/luci-theme-bootstrap/htdocs/luci-static/bootstrap/cascade.css
@@ -492,12 +492,47 @@ select,
box-sizing: border-box;
}
-.cbi-dropdown {
+.cbi-dropdown,
+.cbi-dynlist {
min-width: 210px;
max-width: 400px;
width: auto;
}
+.cbi-dynlist {
+ height: auto;
+ min-height: 30px;
+ display: inline-flex;
+ flex-direction: column;
+}
+
+.cbi-dynlist > .item {
+ margin-bottom: 4px;
+ box-shadow: 0 0 2px #ccc;
+ background: #fff;
+ padding: 2px 2em 2px 4px;
+ border: 1px solid #ccc;
+ border-radius: 3px;
+ position: relative;
+ pointer-events: none;
+}
+
+.cbi-dynlist > .item::after {
+ content: "×";
+ position: absolute;
+ display: inline-flex;
+ align-items: center;
+ top: -1px;
+ right: -1px;
+ bottom: -1px;
+ padding: 0 6px;
+ border: 1px solid #ccc;
+ border-radius: 0 3px 3px 0;
+ font-weight: bold;
+ color: #c44;
+ pointer-events: auto;
+}
+
select {
padding: initial;
background: #fff;
@@ -548,7 +583,8 @@ textarea {
.td > input[type=text],
.td > input[type=password],
.td > select,
-.td > .cbi-dropdown {
+.td > .cbi-dropdown,
+.cbi-dynlist > .add-item > .cbi-dropdown {
width: 100%;
}
@@ -568,11 +604,12 @@ textarea {
color: #bfbfbf;
}
-.btn, .cbi-button, input, textarea {
+.item::after, .btn, .cbi-button, input, textarea {
transition: border linear 0.2s, box-shadow linear 0.2s;
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}
+.item:hover::after,
.btn:hover, .cbi-button:hover,
input:focus, textarea:focus {
outline: 0;
@@ -1206,6 +1243,7 @@ footer {
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
}
+.item::after,
.btn,
.cbi-button {
cursor: pointer;
@@ -1318,6 +1356,7 @@ footer {
color: #404040;
}
+.cbi-dynlist > .item:focus,
.cbi-dropdown:focus {
outline: 2px solid #4b6e9b;
}
@@ -1354,6 +1393,7 @@ footer {
font-weight: bold;
text-shadow: 1px 1px 0px #fff;
display: none;
+ justify-content: center;
}
.cbi-dropdown > ul > li {
@@ -1454,6 +1494,14 @@ footer {
border-bottom: none;
}
+.cbi-dropdown[open] > ul.dropdown > li[unselectable] {
+ opacity: 0.7;
+}
+
+.cbi-dropdown[open] > ul.dropdown > li > input.create-item-input:first-child:last-child {
+ width: 100%;
+}
+
.cbi-dropdown[disabled] {
pointer-events: none;
opacity: .6;