Files
danbooru/app/javascript/src/styles/specific/notes.scss
evazion cc385fa9e4 notes: better fix for note body sizing (#4375).
Setting max-width causes notes to overflow the note body if they set a
fixed `width` or they use `white-space: nowrap` and the line is wider
than the max-width. Using `width: min-content` instead makes the note
shrink to fit but doesn't prevent it from expanding if it needs to.
2020-03-31 01:18:23 -05:00

159 lines
2.7 KiB
SCSS

.note-container {
display: inline-block;
position: relative;
&.hide-notes .note-box {
visibility: hidden;
}
div.note-body {
position: absolute;
border: var(--note-body-border);
background: var(--note-body-background);
color: var(--note-body-text-color);
min-width: 140px;
width: min-content;
min-height: 1em;
line-height: 1.25;
cursor: pointer;
padding: 4px;
z-index: 150;
overflow-wrap: break-word;
}
div.note-body, div.note-box.embedded div.note-box-inner-border {
h1, h2, h3, h4, h5, h6, a, span, div, blockquote, p, ul, li, ol, em, strong, small, big, b, i, font, u, s, code, center {
line-height: 1.25;
}
> :last-child {
margin-bottom: 0;
}
b, strong {
font-weight: bold;
}
i, em {
font-style: italic;
}
small {
font-size: 0.8em;
}
a[rel*="external"] {
word-break: initial;
}
.tn {
font-size: 0.8em;
color: var(--note-tn-color);
}
ruby {
rt {
font-size: 0.8em;
}
}
ul {
margin-left: 1em;
margin-bottom: 1em;
ul {
margin-bottom: 0;
}
li {
list-style-type: disc;
+ br {
display: none;
}
}
}
}
div.note-box {
display: flex;
justify-content: center;
align-items: center;
text-align: center;
position: absolute;
border: var(--note-box-border);
min-width: 5px;
min-height: 5px;
width: 100px;
height: 100px;
cursor: move;
background: var(--note-body-background);
line-height: 1.25;
opacity: 0.5;
z-index: 100;
&.unsaved {
border: var(--unsaved-note-box-border);
}
&.movable {
border: var(--movable-note-box-border);
}
&.embedded {
color: var(--note-body-text-color);
border: 1px solid transparent;
opacity: 1;
&.hovering {
border: var(--note-box-border);
box-shadow: var(--note-box-shadow);
&.editing,
&.movable {
opacity: 1;
}
div.ui-resizable-handle {
display: block;
}
}
&.editing,
&.movable {
opacity: 0.4;
}
&.unsaved,
&.out-of-bounds {
border: var(--unsaved-note-box-border);
}
&.movable {
border: var(--movable-note-box-border);
}
div.ui-resizable-handle {
display: none;
}
}
&.note-box-highlighted {
outline: 2px solid var(--note-highlight-color);
}
}
}
div#note-preview {
position: absolute;
border: var(--note-preview-border);
opacity: 0.6;
display: none;
background: var(--note-preview-background);
z-index: 100;
}
div.note-edit-dialog {
font-size: 0.8em;
}