Use Web 2's form style

This commit is contained in:
Johannes Meyer 2021-12-16 15:09:50 +01:00
parent 4d7df037d3
commit fcadf2d6b4
3 changed files with 37 additions and 118 deletions

View file

@ -0,0 +1,8 @@
<?php
namespace Icinga\Module\Businessprocess\Web\Form\Element;
class Checkbox extends \Icinga\Web\Form\Element\Checkbox
{
}

View file

@ -85,7 +85,7 @@ abstract class QuickForm extends QuickBaseForm
protected function setPreferredDecorators() protected function setPreferredDecorators()
{ {
$this->setAttrib('class', 'autofocus'); $this->setAttrib('class', 'autofocus icinga-controls');
$this->setDecorators( $this->setDecorators(
array( array(
'Description', 'Description',

View file

@ -802,36 +802,10 @@ form input[type=file] {
padding-right: 1em; padding-right: 1em;
} }
form input[type=submit] {
.button();
border-width: 1px;
margin-top: 0.5em;
&:disabled {
border-color: @gray-light;
background-color: @gray-light;
color: @text-color;
}
}
form input[type=submit]:first-of-type { form input[type=submit]:first-of-type {
border-width: 2px; border-width: 2px;
} }
form input[type=submit].link-button {
color: @icinga-blue;
background: none;
border: none;
padding: 0;
text-align: left;
&:hover {
text-decoration: underline;
}
}
form p.description { form p.description {
padding: 1em 1em; padding: 1em 1em;
margin: 0; margin: 0;
@ -839,12 +813,6 @@ form p.description {
width: 100%; width: 100%;
} }
input[type=text], input[type=button], select, select option, textarea {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
}
form ul.form-errors { form ul.form-errors {
margin-bottom: 0.5em; margin-bottom: 0.5em;
@ -852,50 +820,14 @@ form ul.form-errors {
background: @color-critical; background: @color-critical;
font-weight: bold; font-weight: bold;
padding: 0.5em 1em; padding: 0.5em 1em;
color: @text-color; color: @text-color-on-icinga-blue;
} }
} }
select::-ms-expand, input::-ms-expand, textarea::-ms-expand { /* for IE 11 */ input[type=text], input[type=password], input[type=file], textarea, select {
display: none;
}
select {
border: 1px solid @gray;
cursor: pointer;
background: none;
}
input[type=text], input[type=password], textarea, select {
max-width: 36em; max-width: 36em;
min-width: 20em; min-width: 20em;
width: 100%; width: 100%;
line-height: 2em;
height: 2.4em;
padding-left: 0.5em;
border-style: solid;
border-color: transparent;
border-bottom-color: @gray-lighter;
border-width: 1px 1px 1px 3px;
background-color: @low-sat-blue;
&.search {
background: transparent url("../img/icons/search.png") no-repeat scroll 0.5em center / 1em 1em;
padding-left: 2em;
}
}
select[multiple] {
height: auto;
}
select option {
height: 2em;
padding-top: 0.3em;
}
select[multiple=multiple] {
height: auto;
} }
label { label {
@ -907,41 +839,10 @@ form dl {
padding: 0; padding: 0;
} }
select::-moz-focus-inner { border: 0; }
select:-moz-focusring {
color: transparent;
text-shadow: 0 0 0 @black;
}
select, input[type=text], textarea {
&:hover {
border-style: dotted solid dotted solid;
border-color: @gray-light;
}
&:focus, &:focus:hover {
border-style: solid;
border-color: @icinga-blue;
outline: none;
}
}
select[value=""] {
color: @icinga-blue;
border: 1px solid @gray-light;
background-color: @body-bg-color;
}
select option { select option {
color: inherit;
padding-left: 0.5em; padding-left: 0.5em;
} }
select option[value=""] {
color: @disabled-gray;
}
form dt label { form dt label {
width: auto; width: auto;
font-weight: normal; font-weight: normal;
@ -1067,30 +968,40 @@ form dd ul.errors {
} }
} }
form div.hint {
padding: 1em;
background-color: @tr-hover-color;
margin: 1em 0;
max-width: 65em;
font-size: 1em;
pre {
font-style: normal;
background-color: @white;
margin: 0;
padding: 1em;
}
}
form { form {
#_FAKE_SUBMIT { #_FAKE_SUBMIT {
position: absolute; position: absolute;
left: -100%; left: -100%;
} }
} }
/** END of forms **/ /** END of forms **/
/* Form fallback styles, remove once <=2.9.5 support is dropped */
.icinga-controls {
input[type="file"] {
background-color: @low-sat-blue;
}
button[type="button"] {
background-color: @low-sat-blue;
}
}
form.icinga-form {
input[type="file"] {
flex: 1 1 auto;
width: 0;
}
button[type="button"] {
line-height: normal;
}
}
/* Form fallback styles end */
/** Custom font styling **/ /** Custom font styling **/
textarea.smaller { textarea.smaller {
font-size: 0.833em; font-size: 0.833em;