@tomino/dynamic-form-semantic-ui
Version:
Semantic UI form renderer based on dynamic form generation
246 lines (207 loc) • 5.03 kB
text/typescript
import { Theme, css } from '../../common';
export const styledPropertyView = (theme: Theme) => css`
font-family: Lato, 'Helvetica Neue', Arial, Helvetica, sans-serif;
label: propertyStyles;
label {
font-family: Lato, 'Helvetica Neue', Arial, Helvetica, sans-serif;
}
.input {
font-family: Lato, 'Helvetica Neue', Arial, Helvetica, sans-serif;
padding-left: 3px;
height: 25px;
}
.headerButton {
background: ${theme.buttonBackground};
padding: 3px 6px;
color: ${theme.inputColor};
border: 0px solid ${theme.borderColor};
border-radius: 3px;
}
.headerButton:last-of-type {
margin-right: 12px;
}
input {
font-family: Lato, 'Helvetica Neue', Arial, Helvetica, sans-serif;
padding-left: 6px ;
height: 25px;
min-width: 30px;
}
textarea {
font-family: Lato, 'Helvetica Neue', Arial, Helvetica, sans-serif;
min-height: 100px;
resize: vertical;
background-color: ${theme.inputBackground};
color: ${theme.inputColor};
width: 100%;
border-radius: 3px;
padding: 6px;
}
.propertyInput {
display: flex;
flex: 1;
align-items: center;
label: propertyInput;
}
.propertyLabel {
margin: 0px 6px;
label: propertyLabel;
color: ${theme.inputLabel};
}
.ui.dropdown {
border: 0px ;
border-radius: 3px;
background-color: ${theme.inputBackground};
color: ${theme.inputColor};
input,
.selected .text,
.selected .text,
&.visible .text {
color: ${theme.textColor};
}
.text {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: calc(100% - 15px);
}
.selected {
background: ${theme.selectedBackground};
}
.menu.active,
.menu.visible:hover,
.menu.visible {
border: solid 1px ;
border-color: ${theme.borderColor};
}
.menu .item {
background-color: ${theme.menuColor};
color: ${theme.inputColor};
border-top: solid 1px ${theme.borderColor} ;
padding: 6px 10px ;
}
.menu .item:hover {
background-color: ${theme.selectedBackground};
}
.menu .item:hover .text,
.menu .item.selected .text {
color: ${theme.textColor} ;
}
}
.label {
width: 100%;
margin: 3px 0px 6px 0px;
}
.menu {
border-radius: 0px ;
}
.dynamic-active {
display: block;
}
.dynamic-hidden {
display: none;
}
label {
font-weight: bolder;
display: inline-block;
vertical-align: middle;
color: #666;
margin-bottom: 3px;
}
.invalid {
background-color: ${theme.invalidBackground} ;
color: ${theme.invalidColor};
}
.property-table-row-single {
width: 100%;
background: #f8f8f9;
border: solid 1px #ccc;
textarea {
width: 100%;
background: white;
border: 0px;
min-height: 60px;
resize: vertical;
margin-bottom: -3px;
}
}
.property-search {
border-radius: 0px ;
height: 25px ;
padding: 5px 6px 3px 6px ;
min-height: 24px ;
}
.property-search i {
padding: 5px 6px 3px 3px ;
min-height: 25px ;
}
.property-search input {
padding: 5px 6px 3px 3px ;
}
.property-table-row {
width: 100%;
padding-bottom: 4px;
&.flexed {
display: flex;
}
> .only {
flex: 1 1 100%;
}
.padded {
margin: 3px 12px 3px;
background-color: ${theme.inputBackground} ;
color: ${theme.inputColor} ;
border: 1px solid ${theme.inputBorder} ;
}
> .first {
flex: 0 0 100px;
display: inline-block;
border: 0px;
padding: 2px 6px 0px 2px;
color: ${theme.textColor};
}
.second:not(:first-of-type) {
margin-left: 2px;
}
> .full {
width: 100%;
}
> .second {
flex: 1 1 100%;
display: inline-block;
background-color: ${theme.inputBackground} ;
color: ${theme.inputColor} ;
border: 1px solid ${theme.inputBorder} ;
border-radius: 3px;
padding: 0px;
}
input {
border: 0px ;
border-radius: 3px;
color: ${theme.inputColor} ;
background-color: ${theme.inputBackground} ;
}
label {
overflow: hidden;
text-overflow: ellipsis;
display: inline-block;
white-space: nowrap;
vertical-align: top;
margin: 0px;
min-height: 24px;
}
> .holder {
display: inline-block;
padding-left: 6px;
}
textarea {
border: 0px;
min-height: 25px;
}
.dynamic-error-message {
text-align: right;
width: 100%;
margin: 0px;
padding: 3px 6px 4px 0px;
}
}
`;