@plone/volto
Version:
Volto
1,273 lines (1,054 loc) • 21 kB
text/less
// Grids introduce a negative vertical margin that we can't allow inside blocks
// otherwise, it breaks the block engine flow.
.block {
.ui.grid {
margin-top: 0;
margin-bottom: 0;
}
}
[data-rbd-draggable-context-id] {
margin-bottom: 2rem;
}
.block-editor-title .drag.handle.wrapper {
top: 5px;
}
// Here should be placed all blocks that receive (faked) focus
.block:focus {
outline: none;
}
.block .block:not(.inner)::before {
position: absolute;
z-index: -1;
top: -9px;
left: -9px;
width: ~'calc(100% + 18px)';
height: ~'calc(100% + 18px)';
border: 1px solid rgba(120, 192, 215, 0);
border-radius: 3px;
content: '';
}
.block .block-add-button {
display: inline-block;
}
[data-slate-editor='true'] {
outline: none;
}
.block .block.hovered::before,
.block .block:hover::before {
border-color: rgba(120, 192, 215, 0.375);
}
.block .block.selected::before,
.block .block.selected:hover::before {
border-width: 1px;
border-color: rgba(120, 192, 215, 0.75);
}
.block .block.multiSelected::before {
z-index: 1;
background-color: rgba(120, 192, 215, 0.375);
}
.block.selected.error::before,
.block.selected.error:hover::before,
.block.error:hover::before,
.block.error::before {
border-color: #ff0000 ;
}
#toolbar .toolbar-actions .blockCount {
position: absolute;
margin-top: 18px;
margin-left: 15px;
font-size: x-small;
}
.block.video,
.block.image {
/* This fixes two left floated items in a row */
clear: both;
}
// Deprecated
.ui.drag.block:not(:last-child) {
margin-bottom: 2rem;
}
.ui.drag.block.video,
.ui.drag.block.image {
// This fixes the floating images in Volto Editor! Muahahaha
display: block;
// This fixes two left floated items in a row
clear: both;
}
.block .ui.image {
width: 100%;
}
.block .ui.message {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.message-text {
margin-top: 20px;
color: #767676;
}
span {
margin-top: 20px;
}
}
.block.maps {
position: relative;
iframe {
width: 100%;
height: 45vh;
}
}
.map-overlay {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.block.video {
.ui.embed > .placeholder {
top: 50%;
width: unset;
min-width: 100%;
height: unset;
min-height: 100%;
object-fit: cover;
transform: translateY(-50%);
}
video {
width: 100%;
}
}
.block.align.left {
z-index: 2;
&.video .video-inner,
&.maps iframe,
img {
margin-right: 1em ;
margin-bottom: 1em;
float: left;
}
&.video .video-inner {
width: 50%;
.ui.embed {
background: #fff;
}
img {
max-width: 100%;
}
}
&.maps iframe {
width: 50%;
height: 45vh;
}
.ui.image,
img {
max-width: 50%;
}
}
.block.align.right {
z-index: 2;
&.maps iframe,
&.video .video-inner,
img {
margin-bottom: 1em;
margin-left: 1em ;
float: right;
}
&.video .video-inner {
width: 50%;
.ui.embed {
background: #fff;
}
img {
max-width: 100%;
}
}
&.maps iframe {
width: 50%;
height: 45vh;
}
.ui.image,
img {
max-width: 50%;
}
}
.block.align.center {
text-align: center;
iframe,
img {
max-width: 100%;
margin-right: auto;
margin-left: auto;
&.medium {
max-width: 50%;
}
&.small {
max-width: 25%;
}
}
iframe {
width: 100%;
}
}
.draggable {
position: absolute;
top: 20px;
left: -32px;
}
// Hacks for the full width image
body .ui.wrapper > .block.align.full,
body.has-toolbar.has-sidebar .ui.wrapper > .ui.inner .block.align.full,
body.has-toolbar-collapsed.has-sidebar
.ui.wrapper
> .ui.inner
.block.align.full,
body.has-toolbar-collapsed.has-sidebar-collapsed
.ui.wrapper
> .ui.inner
.block.align.full,
body.has-toolbar.has-sidebar-collapsed
.ui.wrapper
> .ui.inner
.block.align.full {
width: 100% ;
iframe {
width: 100%;
}
img {
width: 100%;
}
}
body.has-toolbar.has-sidebar .ui.wrapper > .ui.inner.block.full,
body.has-toolbar-collapsed.has-sidebar .ui.wrapper > .ui.inner.block.full,
body.has-toolbar-collapsed.has-sidebar-collapsed
.ui.wrapper
> .ui.inner.block.full,
body.has-toolbar.has-sidebar-collapsed .ui.wrapper > .ui.inner.block.full {
width: 100% ;
iframe {
width: 100%;
}
img {
width: 100%;
}
}
.block.align:not(.right):not(.left) {
clear: both;
}
.title.block .public-DraftEditorPlaceholder-inner {
font-size: @h1;
font-weight: @headerFontWeight;
line-height: @headerLineHeight;
}
.ui.block.table {
border: 0;
}
.block {
position: relative;
margin-bottom: 1em;
h1:last-child,
h2:last-child,
h3:last-child,
h4:last-child,
h5:last-child {
margin: @headerMargin;
}
p {
margin: @paragraphMargin;
}
.toolbar {
position: absolute;
z-index: 10;
top: -32px;
left: 50%;
display: flex;
padding: 4px;
border-radius: 2px;
background-color: rgba(255, 255, 255, 0.975);
box-shadow:
0 0 8px rgba(0, 0, 0, 0.1),
0 2px 4px rgba(0, 0, 0, 0.05);
transform: translate(-50%, 0);
.separator {
position: relative;
top: 5px;
display: inline-block;
height: 24px;
border-right: 1px solid #ddd;
margin: 0 0 4px 4px;
vertical-align: bottom;
}
form {
display: flex;
}
& > svg {
display: inline-block ;
box-sizing: content-box;
padding: 4px;
margin-right: 4px;
color: @brown ;
}
.ui.input > input {
padding: 0;
border: none;
}
.ui.icon.button {
padding: 4px;
border-radius: 1px;
margin-left: 4px;
color: @brown ;
&:hover {
background-color: #edf1f2 ;
}
}
.ui.buttons:first-child {
& .ui.icon.button {
margin-left: 0;
}
}
}
.toolbar-inner {
display: flex;
width: ~'min(100%, 450px)';
height: 40px;
padding: 4px;
border-radius: 2px;
background-color: rgba(255, 255, 255, 0.975);
box-shadow:
0 0 8px rgba(0, 0, 0, 0.1),
0 2px 4px rgba(0, 0, 0, 0.05);
form {
display: flex;
}
& > svg {
display: inline-block ;
box-sizing: content-box;
padding: 4px;
margin-right: 4px;
color: @brown ;
}
.ui.input {
width: 100%;
margin-left: 8px;
}
.ui.input > input {
padding: 0;
border: none;
}
.ui.icon.button {
padding: 4px;
border-radius: 1px;
margin-left: 4px;
&:hover {
background-color: #edf1f2 ;
}
}
.ui.buttons:first-child {
& .ui.icon.button {
margin-left: 0;
}
}
}
}
.toolbar-buttons {
// used by the ImageUploadWidget
display: flex;
justify-content: center;
gap: 4px;
}
.image-upload-widget-toolbar {
position: absolute;
top: 1em;
right: 1em;
.sidebar-container & .ui.icon.button:hover {
background: transparent ;
}
.icon.circled {
border: 1px solid #e4e8ec;
background: #f3f5f7;
box-shadow: inset 0 0 0 0.14285714rem transparent ;
&:hover {
background-color: #e4e8ec;
}
}
}
div.image-upload-widget-image {
position: relative;
img {
max-width: 100% ;
}
}
.image-upload-widget {
text-align: center;
.toolbar-wrapper {
position: relative;
display: flex;
flex-direction: column;
justify-content: flex-end;
}
}
.ui.active.basic.icon.button {
border: 1px solid #2996da;
background: transparent ;
}
// Hero block
.block.hero {
clear: both;
.toolbar {
left: 25%;
}
.hero-body {
display: flex;
max-height: 400px;
flex: 1 1;
flex-direction: column;
justify-content: space-between;
padding: 30px;
background-color: @tealBackground;
overflow-y: hidden;
h1 {
margin-top: 0;
}
p {
max-height: 287px;
margin: 0;
overflow-y: hidden;
word-break: break-word;
}
.link-more {
text-align: right;
}
}
.hero-image {
display: block;
width: auto;
max-width: 50%;
height: auto;
max-height: 400px;
}
.image-add {
min-width: 50%;
}
.image-message {
min-height: 400px ;
}
.block-inner-wrapper {
position: relative;
z-index: 1;
display: flex;
}
.title-editor,
.description-editor {
max-height: 287px;
overflow-y: hidden;
word-break: break-word;
}
}
.ui.basic.button.block-add-button {
position: absolute;
z-index: 2;
margin-bottom: 0;
-webkit-box-shadow: none;
box-shadow: none;
color: #b8c6c8 ;
&.new-add-block {
bottom: -26px;
left: calc(
50% - 12px
); // This is to compensate the width of the icon and center it correctly
padding: 0 ;
border: none ;
border-radius: 50% ;
background: white ;
}
&:not(.new-add-block) {
top: -2px;
padding: 0;
border: none;
transform: translateX(-40px);
}
&:hover,
&:focus {
-webkit-box-shadow: none;
box-shadow: none;
color: @brown ;
}
}
.block .ui.basic.button.delete-button {
position: absolute;
top: 0;
right: 0;
padding: 0;
border: none;
-webkit-box-shadow: none;
box-shadow: none;
&:hover,
&:focus {
-webkit-box-shadow: none;
box-shadow: none;
color: #e40166 ;
}
}
// .ui.basic.button.block-delete-button {
// top: 22px;
// right: 0;
// color: #b8c6b8 !important;
// transform: translateX(40px);
// &:hover,
// &:focus {
// -webkit-box-shadow: none;
// box-shadow: none;
// color: #e40166 !important;
// }
// }
.drag.block.wrapper {
position: relative;
}
.drag.handle.wrapper {
position: absolute;
z-index: 10;
// top: 1px;
left: 0;
color: #b8c6c8;
.icon {
border-radius: 2px;
background: rgba(255, 255, 255, 0.2);
}
&:hover {
background-color: #edf1f2;
color: @brown;
}
}
// Deprecated
.drag.block.title .drag.handle.wrapper {
top: 5px;
}
.drag.handle.wrapper.hidden {
display: none ;
}
.description.block .public-DraftEditorPlaceholder-inner {
font-size: 1.125rem;
line-height: @lineHeight;
}
.callout {
padding: 1em;
border: 1px solid rgba(34, 36, 38, 0.15);
border-radius: 0.28571429rem;
margin: 1rem 0;
box-shadow: 0 1px 2px 0 rgba(34, 36, 38, 0.15);
}
.ui.blocker {
position: absolute;
z-index: 1;
width: 100%;
height: 100%;
}
// HTML block
.html-editor {
z-index: 1;
border-radius: 4px;
background-color: #f3f6f7;
font-family: monospace;
font-size: @16px;
word-break: break-all ;
&:focus-within textarea {
caret-color: #e40166;
outline: 0;
}
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: #90a4ae;
}
.token.punctuation {
color: #9e9e9e;
}
.namespace {
opacity: 0.7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #e91e63;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #4caf50;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #795548;
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #3f51b5;
}
.token.function {
color: #f44336;
}
.token.regex,
.token.important,
.token.variable {
color: #ff9800;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
.link-form-container {
.inline.field .wrapper {
width: 270px; // needed to ensure placeholder shows and buttons are aligned to the right
min-height: initial; // overrides .input.field .wrapper
justify-content: space-between;
border-bottom: none;
}
.ui.input-anchorlink-theme {
width: 100% ; // overrides form.less width: auto
max-width: 81%; // needed so buttons don't shift to the right when value is present
margin-left: 0 ; // overrides .block .toolbar-inner .ui.input
}
.ui.buttons {
width: auto; // for Add Link popup button to be aligned to the right
}
button {
padding: 0;
border: 0;
background: transparent;
color: @linkColor;
cursor: pointer;
text-align: initial;
text-decoration: underline;
&:focus {
outline: none;
}
}
}
.blocks-chooser {
width: 310px;
padding: 4px;
border-radius: 2px;
background-color: rgba(255, 255, 255, 0.975);
box-shadow:
0 0 8px rgba(0, 0, 0, 0.1),
0 2px 4px rgba(0, 0, 0, 0.05);
&:not(.new-add-block) {
top: -12px;
left: -9px;
}
.ui.basic.button {
display: flex;
width: 100px;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 20px 0;
border-radius: 3px;
margin-top: 5px;
margin-bottom: 5px;
color: @brown ;
hyphens: auto;
text-align: center;
&:hover,
&:focus {
background: #edf2f3 ;
}
.icon {
margin-bottom: 10px ;
}
&.table {
border: none;
}
small {
padding-top: 5px;
color: @teal;
}
}
.ui.accordion {
.active {
display: flex;
}
.title {
display: flex;
justify-content: space-between;
}
.content {
padding: 0;
}
}
.ui.accordion .title ~ .content,
.ui.accordion .accordion .title ~ .content {
// reseting the default Accordion behavior
display: initial;
}
.ui.form .ui.input input {
padding-left: 5px;
//reset for semantic-ui outline:none
border-width: @1px;
border-color: transparent;
&:focus {
border-color: @focusedFormBorderColor;
}
}
}
.accordion-tools {
display: flex;
align-items: center;
.ui.basic.button {
margin-right: 10px;
&:hover {
background-color: transparent ;
}
}
}
// Listing Block
.listing {
.items-preview {
color: @teal;
text-align: center;
}
}
.listing.message {
padding: 1.5em;
background: #f9edbe;
color: #613a00;
text-align: center;
}
.listing-item,
.listing-item a {
display: flex;
width: 100%;
align-items: flex-start;
@media only screen and (max-width: (@largestMobileScreen)) {
flex-direction: column;
}
}
.listing-item {
margin-bottom: 20px;
img {
width: 15%;
height: auto;
margin-right: 20px;
@media only screen and (max-width: (@largestMobileScreen)) {
width: 100%;
margin: 0;
}
}
.image-placeholder {
display: flex;
width: 15%;
justify-content: center;
margin-right: 20px;
img {
width: 100%;
max-width: 100%;
}
}
a {
p {
color: @textColor;
}
}
@media only screen and (max-width: (@largestMobileScreen)) {
h3 {
margin-top: 1em;
}
}
}
.sidebar-listing-data {
&.ui.form.segment,
&.listing-style {
padding-bottom: 20px;
}
.simple-field-name {
padding-top: 20px;
padding-bottom: 10px;
font-weight: 500;
}
.fields {
flex-wrap: wrap;
padding-bottom: 20px;
border-bottom: 1px dotted @borderColor;
}
.fields:last-child {
padding-bottom: 0;
border-bottom: none;
}
.main-fields-wrapper {
display: flex;
width: 100%;
flex: 1 0 auto;
padding-right: 0.5em;
padding-left: 0.5em;
}
.button .icon {
margin: 0 ;
}
}
.link-form-container {
// ToDo: Improve CSS in anchor link component (previously from CSS module to normal theme)
.input-anchorlink-theme {
width: 240px;
height: 34px;
padding: 0 12px;
border: none;
background-color: transparent;
color: #444;
font-family: inherit;
font-size: 15px;
}
.input-anchorlink-theme:focus {
outline: none;
}
.input-anchorlink-theme::placeholder {
color: #888;
}
.input-anchorlink-theme-Invalid {
color: #e65757;
}
.link-anchorlink-theme {
color: #007eb1;
text-decoration: underline;
}
}
// In the sidebar, the height is forced on all .ui.input T_T
.ui.form .ui.input.input-anchorlink-theme,
.ui.form
.inline.field
.link-form-container
.wrapper
.ui.input.input-anchorlink-theme
input {
height: 34px;
}
.block.image.align.left,
.block.image.align.right {
img {
&.large {
max-width: 50%;
}
&.medium {
max-width: 25%;
}
&.small {
max-width: 15%;
}
}
}
.block.image .no-image-wrapper {
width: ~'min(100%, 450px)';
}
// Search block
.block.search {
.search-wrapper {
display: flex;
flex-direction: row;
align-items: center;
margin-bottom: 1.5em;
.search-input {
position: relative;
width: 100%;
& + .button {
margin-left: 1.5em;
}
}
.ui.input > input {
padding-left: 10px;
}
}
.search-block-prompt {
display: block;
margin-bottom: 0.5rem;
}
.facets {
> .facet:first-child {
padding-top: 0 ;
}
.segment.facet {
padding-right: 0;
padding-left: 0;
}
}
.items {
padding: 1.5em 0;
}
.ui.accordion.filter-listing {
flex: 1 0 auto;
margin-bottom: 1.5em;
.filter-list-header {
display: flex;
justify-content: space-between;
padding: 0.5rem;
border-radius: 0.3rem;
background-color: #faf8f8;
}
.active.title .filter-list-title svg {
transform: rotate(90deg);
}
.ui.basic.button:hover {
background: transparent ;
}
.filter-list-title {
display: flex;
align-items: center;
}
.filter-list-content {
padding-top: 0 ;
}
.filter-list-group {
display: flex;
align-items: center;
margin: 0.5rem 0;
.ui.labels {
display: flex;
flex-direction: row;
align-items: baseline;
margin-right: 1.2em;
}
.ui.label {
border: 1px solid #f3f3f3;
margin-left: 0.8em;
background-color: transparent;
font-weight: bold;
}
.label-title {
font-size: small;
}
}
}
.search-sort-wrapper {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-end;
@media only screen and (max-width: (@largestMobileScreen)) {
margin-bottom: 1.5em;
}
.ui.basic.button {
padding: 3px ;
}
}
.search-sort-on {
display: flex;
flex-direction: row;
align-items: center;
margin-right: 0.5em;
.sorted-label-value {
margin-right: 0.5em;
margin-left: 0.7em;
color: @lightGrey;
}
}
.sort-label {
margin-right: 0.7em;
}
.search-details {
color: @lightTextColor;
}
.search-filters-sort {
display: flex;
align-items: flex-start;
@media only screen and (max-width: (@largestMobileScreen)) {
flex-direction: column;
}
.filter-listing {
padding-right: 1em;
margin-bottom: 0 ;
@media only screen and (max-width: (@largestMobileScreen)) {
width: 100%;
padding-right: 0;
margin-bottom: 1.5em ;
}
}
// .search-sort-wrapper {
// @media only screen and (min-width: (@largestMobileScreen)) {
// padding-top: 4px;
// }
// }
}
.search-results-count-sort {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 1.5em;
@media only screen and (max-width: (@largestMobileScreen)) {
flex-direction: column-reverse;
align-items: flex-start;
}
.search-details {
margin: 0;
}
.sort-views-wrapper {
display: flex;
gap: 1em;
}
}
.search-input-actions {
position: absolute;
top: 0;
right: 0;
display: flex;
height: 100%;
align-items: center;
svg {
width: 28px ;
height: 28px ;
}
.ui.button {
margin: 0 5px;
}
.divider {
width: 1px;
height: 60%;
border-right: 1px solid #dfe1e5;
}
}
.daterange-facet {
.ui.date-input input {
height: auto;
}
.ui-button {
margin: 0;
}
.DateInput {
width: 40%;
min-width: 75px;
}
.DateRangePickerInput_arrow_svg {
margin: 0 6px;
}
.DateRangePicker_picker {
z-index: 10;
}
.radio {
display: flex;
min-height: 37px;
align-items: center;
}
}
}
// If using popperjs, we need also to set preference too to the
// popperjs container. The sidebar container has 150, so it has to be higher.
[data-popper-placement] {
z-index: 200;
}
@import 'teaser';