silverstripe-framework/admin/scss/_forms.scss

252 lines
6.0 KiB
SCSS
Executable File

/**
* This file defines common styles for form elements used throughout the CMS interface.
* It is an addition to the base styles defined in sapphire/css/Form.css.
*
* @package sapphire
* @subpackage admin
*/
/** ----------------------------------------------------
* Basic form fields
* ---------------------------------------------------- */
.field {
display: block;
// bottom padding accounts for the border
padding: 0 0 ($grid-vertical - 1) 0;
margin: 0 0 $grid-vertical 0;
border-bottom: 1px solid $color-shadow-light;
overflow: hidden;
label.left {
float: left;
width: $grid-horizontal * 20;
padding: $grid-vertical $grid-horizontal;
line-height: $grid-vertical * 2;
@include hide-text-overflow();
span {
display: block;
font-size: $font-base-size - 1;
color: lighten($color-text, 25%);
@include hide-text-overflow();
}
}
.middleColumn {
margin-left: $grid-horizontal * 24;
}
}
form.nostyle {
@include clear-form-field-styles();
}
.field.nolabel {
.middleColumn {
margin-left: 0;
}
}
.field {
input.text,
textarea,
select {
width: 70%;
}
input.text,
textarea {
@include border-radius(4px);
background: #fff;
@include background-image(linear-gradient(#efefef, #fff 10%, #fff 90%, #efefef));
border: 1px solid lighten($color-medium-separator, 20%);
// remove 1px for the border.
padding: ($grid-vertical - 1) ($grid-horizontal - 1);
margin: 0;
outline: none;
}
input.text:focus,
textarea:focus {
border: 1px solid $color-medium-separator;
}
select {
margin-top: $grid-vertical;
}
}
/** ----------------------------------------------------
* Buttons
* ---------------------------------------------------- */
.cms {
input.loading,
input.ui-state-default.loading, .ui-widget-content input.ui-state-default.loading,
.ui-widget-header input.ui-state-default.loading {
padding-left: ($grid-horizontal * 2) - 1;
background: $color-widget-bg url(../../images/network-save.gif) no-repeat center left;
}
.ss-ui-button.ss-ui-action-constructive,
.ui-widget-content .ss-ui-button.ss-ui-action-constructive,
.ui-widget-header .ss-ui-button.ss-ui-action-constructive {
padding-left: ($grid-horizontal * 4) - 1;
color: $color-text-light;
border-color: $color-button-constructive-border;
@include background(image-url("../images/btn_icons_sprite.png") no-repeat 5px 6px,
linear-gradient(color-stops(
$color-button-constructive-light,
$color-button-constructive-dark
))
);
background-color: $color-button-constructive-light;
@include text-shadow(darken($color-base, 40%) 1px 1px 0);
@include box-shadow(darken($color-base, 20%) 1px 1px 2px);
}
.ss-ui-button.ss-ui-action-constructive.ui-state-hover {
@include background(image-url("../images/btn_icons_sprite.png") no-repeat 5px 6px,
linear-gradient(color-stops(
darken($color-button-constructive-light, 2%),
darken($color-button-constructive-dark, 3%)
))
);
background-color: $color-button-constructive-dark;
@include box-shadow(darken($color-base, 10%) 1px 1px 1px);
}
.ss-ui-button.ss-ui-action-constructive.cms-page-add-button {
background-position: 5px -155px;
}
.ss-ui-button.ss-ui-action-destructive,
.ui-widget-content .ss-ui-button.ss-ui-action-destructive,
.ui-widget-header .ss-ui-button.ss-ui-action-destructive {
color: $color-button-destructive;
background-color: $color-button-generic-light;
}
.ss-ui-button.ss-ui-action-destructive.delete {
padding-left: 23px;
color: $color-button-destructive;
border-color: $color-button-generic-border;
@include background(image-url("../images/btn_icons_sprite.png") no-repeat 5px -26px,
linear-gradient(color-stops(
$color-button-generic-light,
$color-button-generic-dark
))
);
@include text-shadow(none);
@include box-shadow(darken($color-base, 2%) 1px 1px 2px);
}
.ss-ui-button.ss-ui-action-destructive.delete.ui-state-hover {
@include background(image-url("../images/btn_icons_sprite.png") no-repeat 5px -26px,
linear-gradient(color-stops(
darken($color-button-generic-light, 2%),
darken($color-button-generic-dark, 3%)
))
);
background-color: $color-button-generic-dark;
@include box-shadow(darken($color-base, 10%) 1px 1px 1px);
}
.ss-ui-button.ss-ui-action-minor,
.ui-widget-content .ss-ui-button.ss-ui-action-minor
.ui-widget-header .ss-ui-button.ss-ui-action-minor {
background: none;
padding: 0;
border: 0;
color: $color-text-dark;
text-decoration: underline;
}
}
/** ----------------------------------------------------
* Grouped form fields
* ---------------------------------------------------- */
.fieldgroup {
.fieldgroup-field {
float: left;
display: block;
width: $grid-horizontal * 23;
padding-right: $grid-horizontal;
&.odd {
}
&.even {
}
}
}
/** ----------------------------------------------------
* Checkbox Field
* ---------------------------------------------------- */
.checkbox {
padding-left: $grid-vertical * 24;
}
/** ----------------------------------------------------
* Optionsets and Checkboxsets
* ---------------------------------------------------- */
.optionset {
li {
float: left;
display: block;
width: $grid-horizontal * 31;
padding: $grid-vertical $grid-horizontal;
line-height: $grid-vertical * 2;
list-style: none;
position: relative;
input {
position: absolute;
top: $grid-vertical + 1; // used to get the input off the edge, the overflow
left: 2px; // hidden crops the glow.
margin: 0;
}
label {
display: block;
cursor: pointer;
padding: 0 0 0 $grid-vertical * 2;
}
}
}
/** ----------------------------------------------------
* Specific field overrides
* ---------------------------------------------------- */
.htmleditor {
label {
display: block;
float: none;
padding-bottom: 10px;
}
.middleColumn {
margin-left: 0px;
clear: left;
}
}
#Url label
.field#ViewerGroups, .field#EditorGroups, .field#CreateTopLevelGroups {
label {
display: none;
}
}
.action-hidden {
display: none;
}