jlukic 11 years ago
parent
commit
274b357fdb
  1. 43
      server/documents/modules/dropdown.html.eco
  2. 40
      src/collections/form.less
  3. 42
      src/modules/dropdown.less

43
server/documents/modules/dropdown.html.eco

@ -470,7 +470,6 @@ type : 'UI Module'
</div> </div>
</div> </div>
<div class="hover example"> <div class="hover example">
<h3 class="ui header">Menu</h3> <h3 class="ui header">Menu</h3>
<p>A <a href="/collections/menu.html">menu</a> element can contain a dropdown</p> <p>A <a href="/collections/menu.html">menu</a> element can contain a dropdown</p>
@ -535,6 +534,48 @@ type : 'UI Module'
</div> </div>
</div> </div>
<div class="dropdown example">
<h3 class="ui header">Selection with error state</h3>
<p>A <a href="/modules/dropdown.html">dropdown</a> can have error state</p>
<div class="ui dropdown selection error">
<input type="hidden" name="gender">
<div class="default text">...</div>
<i class="dropdown icon"></i>
<div class="menu">
<div class="item" data-value="male">Male</div>
<div class="item" data-value="female">Female</div>
</div>
</div>
</div>
<div class="dropdown example">
<p>It works inside a <a href="/collections/form.html">form</a> too</p>
<div class="ui form segment">
<p>Let's go ahead and get you signed up.</p>
<div class="two fields">
<div class="field">
<label>First Name</label>
<input placeholder="First Name" type="text">
</div>
<div class="field">
<label>Last Name</label>
<input placeholder="Last Name" type="text">
</div>
</div>
<div class="field error">
<label>Gender</label>
<div class="ui dropdown selection">
<input type="hidden" name="gender">
<div class="default text">...</div>
<i class="dropdown icon"></i>
<div class="menu">
<div class="item" data-value="male">Male</div>
<div class="item" data-value="female">Female</div>
</div>
</div>
</div>
</div>
</div>
<div class="transition example"> <div class="transition example">
<h3 class="ui header">Transitions</h3> <h3 class="ui header">Transitions</h3>
<p>A dropdown can have different <a href="/modules/transition.html">transitions</a>.</p> <p>A dropdown can have different <a href="/modules/transition.html">transitions</a>.</p>

40
src/collections/form.less

@ -288,6 +288,7 @@
-moz-box-shadow: 0.3em 0em 0em 0em #D95C5C inset; -moz-box-shadow: 0.3em 0em 0em 0em #D95C5C inset;
box-shadow: 0.3em 0em 0em 0em #D95C5C inset; box-shadow: 0.3em 0em 0em 0em #D95C5C inset;
} }
.ui.form .field.error textarea:focus, .ui.form .field.error textarea:focus,
.ui.form .field.error input[type="text"]:focus, .ui.form .field.error input[type="text"]:focus,
.ui.form .field.error input[type="email"]:focus, .ui.form .field.error input[type="email"]:focus,
@ -305,6 +306,45 @@
box-shadow: 0.3em 0em 0em 0em #FF5050 inset; box-shadow: 0.3em 0em 0em 0em #FF5050 inset;
} }
/*----------------------------
Dropdown Selection Warning
-----------------------------*/
.ui.form .fields.error .field .ui.selection.dropdown,
.ui.form .fields.error .field .ui.selection.dropdown .item,
.ui.form .field.error .ui.selection.dropdown,
.ui.form .field.error .ui.selection.dropdown .item {
background-color: #FFFAFA;
color: #D95C5C;
}
.ui.form .fields.error .field .ui.selection.dropdown,
.ui.form .field.error .ui.selection.dropdown {
-webkit-box-shadow: 0px 0px 0px 1px #E7BEBE !important;
box-shadow: 0px 0px 0px 1px #E7BEBE !important;
}
.ui.form .fields.error .field .ui.selection.dropdown:hover,
.ui.form .field.error .ui.selection.dropdown:hover {
-webkit-box-shadow: 0px 0px 0px 1px #E7BEBE !important;
box-shadow: 0px 0px 0px 1px #E7BEBE !important;
}
.ui.form .fields.error .field .ui.selection.dropdown:hover .menu,
.ui.form .field.error .ui.selection.dropdown:hover .menu {
-webkit-box-shadow: 0px 1px 0px 1px #E7BEBE;
-moz-box-shadow: 0px 1px 0px 1px #E7BEBE;
box-shadow: 0px 1px 0px 1px #E7BEBE;
}
.ui.form .fields.error .field .ui.selection.dropdown .menu .item:hover,
.ui.form .field.error .ui.selection.dropdown .menu .item:hover {
background-color: #FFF2F2;
}
.ui.form .fields.error .field .ui.selection.dropdown .menu .active.item,
.ui.form .field.error .ui.selection.dropdown .menu .active.item {
background-color: #FDCFCF !important;
}
/*-------------------- /*--------------------
Empty (Placeholder) Empty (Placeholder)
---------------------*/ ---------------------*/

42
src/modules/dropdown.less

@ -361,6 +361,35 @@
margin-right: 0.5em; margin-right: 0.5em;
} }
/*--------------------
Error
----------------------*/
.ui.selection.dropdown.error,
.ui.selection.dropdown.error .item {
background-color: #FFFAFA;
color: #D95C5C;
}
.ui.selection.dropdown.error {
-webkit-box-shadow: 0px 0px 0px 1px rgba(231, 190, 190, 1) !important;
box-shadow: 0px 0px 0px 1px rgba(231, 190, 190, 1) !important;
}
.ui.selection.dropdown.error .menu {
-webkit-box-shadow: 0px 1px 0px 1px #E7BEBE;
-moz-box-shadow: 0px 1px 0px 1px #E7BEBE;
box-shadow: 0px 1px 0px 1px #E7BEBE;
-moz-border-radius: 0px 0px 0.325em 0.325em;
-webkit-border-radius: 0px 0px 0.325em 0.325em;
border-radius: 0px 0px 0.325em 0.325em;
}
/* Menu Item Active */
.ui.selection.dropdown.error .menu .active.item {
background-color: #FDCFCF !important;
}
/* Hover */ /* Hover */
.ui.selection.dropdown:hover { .ui.selection.dropdown:hover {
-webkit-box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.2) !important; -webkit-box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.2) !important;
@ -375,6 +404,18 @@
.ui.selection.dropdown:hover > .dropdown.icon { .ui.selection.dropdown:hover > .dropdown.icon {
opacity: 1; opacity: 1;
} }
.ui.selection.dropdown.error:hover {
-webkit-box-shadow: 0px 0px 0px 1px rgba(231, 190, 190, 1) !important;
box-shadow: 0px 0px 0px 1px rgba(231, 190, 190, 1) !important;
}
.ui.selection.dropdown.error:hover .menu {
-webkit-box-shadow: 0px 1px 0px 1px #E7BEBE;
-moz-box-shadow: 0px 1px 0px 1px #E7BEBE;
box-shadow: 0px 1px 0px 1px #E7BEBE;
}
.ui.selection.dropdown.error .menu .item:hover {
background-color: #FFF2F2;
}
/* Visible */ /* Visible */
.ui.visible.selection.dropdown { .ui.visible.selection.dropdown {
@ -384,7 +425,6 @@
/* Active */ /* Active */
.ui.active.selection.dropdown { .ui.active.selection.dropdown {
-webkit-border-radius: 0.3125em 0.3125em 0em 0em !important; -webkit-border-radius: 0.3125em 0.3125em 0em 0em !important;
-moz-border-radius: 0.3125em 0.3125em 0em 0em !important; -moz-border-radius: 0.3125em 0.3125em 0em 0em !important;
border-radius: 0.3125em 0.3125em 0em 0em !important; border-radius: 0.3125em 0.3125em 0em 0em !important;

Loading…
Cancel
Save