2023-04-20 06:37:29 +02:00
|
|
|
|
// Comments
|
|
|
|
|
$icon-size: theme('spacing.4');
|
|
|
|
|
$button-padding: theme('spacing.2');
|
|
|
|
|
|
2022-07-25 16:20:19 +02:00
|
|
|
|
.w-field__comment-button {
|
2022-09-14 17:30:37 +02:00
|
|
|
|
$root: &;
|
|
|
|
|
|
2022-07-25 16:20:19 +02:00
|
|
|
|
@include transition(opacity 0.2s ease);
|
|
|
|
|
position: absolute;
|
2023-04-19 07:58:14 +02:00
|
|
|
|
color: theme('colors.text-button-outline-default');
|
2022-07-25 16:20:19 +02:00
|
|
|
|
background: none;
|
|
|
|
|
border: 0;
|
2023-04-20 06:37:29 +02:00
|
|
|
|
padding: theme('spacing.4') $button-padding;
|
|
|
|
|
inset-inline-end: calc(-1 * ($icon-size + $button-padding * 2));
|
2022-09-14 17:30:37 +02:00
|
|
|
|
top: 50%;
|
|
|
|
|
transform: translateY(-50%);
|
2023-05-12 10:39:26 +02:00
|
|
|
|
// Only show the buttons when commenting is enabled.
|
|
|
|
|
display: none;
|
2022-09-14 17:30:37 +02:00
|
|
|
|
opacity: 0;
|
2022-07-25 04:33:09 +02:00
|
|
|
|
|
2022-07-25 16:20:19 +02:00
|
|
|
|
.icon {
|
2023-04-20 06:37:29 +02:00
|
|
|
|
width: $icon-size;
|
|
|
|
|
height: $icon-size;
|
2022-07-25 16:20:19 +02:00
|
|
|
|
color: inherit;
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-12 10:39:26 +02:00
|
|
|
|
.tab-content--comments-enabled & {
|
|
|
|
|
display: block;
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-25 16:20:19 +02:00
|
|
|
|
// For devices without hover support, always show when comments are enabled.
|
|
|
|
|
@media (hover: none) {
|
|
|
|
|
.tab-content--comments-enabled & {
|
|
|
|
|
opacity: 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-07-25 04:33:09 +02:00
|
|
|
|
|
2022-07-25 16:20:19 +02:00
|
|
|
|
// Hide by default, reveal on hover of parent, for devices supporting hover interaction
|
|
|
|
|
@media (hover: hover) {
|
2023-05-12 10:39:26 +02:00
|
|
|
|
.w-field__input:hover > &,
|
|
|
|
|
.w-field__input:focus-within > &,
|
2022-07-25 16:20:19 +02:00
|
|
|
|
&:hover,
|
|
|
|
|
&:focus,
|
|
|
|
|
&.w-field__comment-button--focused {
|
|
|
|
|
opacity: 1;
|
2022-07-25 04:33:09 +02:00
|
|
|
|
}
|
2022-07-25 16:20:19 +02:00
|
|
|
|
}
|
2022-07-25 04:33:09 +02:00
|
|
|
|
|
2022-09-14 17:30:37 +02:00
|
|
|
|
// Special positioning of comment icons to sit at the top right of these fields
|
|
|
|
|
textarea ~ &,
|
|
|
|
|
.w-field--checkbox_select_multiple &,
|
|
|
|
|
.w-field--admin_tag_widget & {
|
|
|
|
|
transform: translateY(0);
|
2023-04-20 06:37:29 +02:00
|
|
|
|
top: 0;
|
2022-07-25 04:33:09 +02:00
|
|
|
|
}
|
2022-11-19 00:07:24 +01:00
|
|
|
|
|
|
|
|
|
.w-field--date_field &,
|
|
|
|
|
.w-field--date_time_field &,
|
|
|
|
|
.w-field--time_field & {
|
|
|
|
|
position: relative;
|
|
|
|
|
transform: translateY(0);
|
2023-04-20 06:37:29 +02:00
|
|
|
|
top: 0;
|
2022-11-19 00:07:24 +01:00
|
|
|
|
}
|
2022-07-25 16:20:19 +02:00
|
|
|
|
}
|
2022-07-25 04:33:09 +02:00
|
|
|
|
|
2022-07-25 16:20:19 +02:00
|
|
|
|
.w-field__comment-button--add {
|
|
|
|
|
.icon-comment-add,
|
|
|
|
|
.icon-comment-add-reversed {
|
|
|
|
|
display: none;
|
2022-07-25 04:33:09 +02:00
|
|
|
|
}
|
|
|
|
|
|
2022-07-25 16:20:19 +02:00
|
|
|
|
&:not(:hover) {
|
2023-04-20 07:03:31 +02:00
|
|
|
|
.icon-comment-add-reversed {
|
2022-07-25 16:20:19 +02:00
|
|
|
|
display: block;
|
2022-07-25 04:33:09 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-25 16:20:19 +02:00
|
|
|
|
&:hover {
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
|
2023-04-20 07:03:31 +02:00
|
|
|
|
.icon-comment-add {
|
2022-07-25 16:20:19 +02:00
|
|
|
|
display: block;
|
2022-07-25 04:33:09 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2022-07-25 16:20:19 +02:00
|
|
|
|
|
|
|
|
|
// Hide the "Add comment" button if it’s preceded by a "Reveal comment" button.
|
|
|
|
|
.w-field__comment-button--reveal + & {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.w-field__comment-button--reveal {
|
|
|
|
|
display: none;
|
|
|
|
|
|
|
|
|
|
.tab-content--comments-enabled & {
|
|
|
|
|
display: block;
|
|
|
|
|
}
|
2022-07-25 04:33:09 +02:00
|
|
|
|
}
|