Skip to content

Commit

Permalink
[Glitch] Change design of rich text elements in web UI
Browse files Browse the repository at this point in the history
Port d11231a to glitch-soc

Signed-off-by: Claire <[email protected]>
  • Loading branch information
Gargron authored and ClearlyClaire committed Oct 26, 2024
1 parent 50a40d1 commit 227bf77
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,7 @@ body {
--background-color-tint: rgba(255, 255, 255, 80%);
--background-filter: blur(10px);
--on-surface-color: #{transparentize($ui-base-color, 0.65)};
--rich-text-container-color: rgba(255, 216, 231, 100%);
--rich-text-text-color: rgba(114, 47, 83, 100%);
--rich-text-decorations-color: rgba(255, 175, 212, 100%);
}
74 changes: 66 additions & 8 deletions app/javascript/flavours/glitch/styles/rich_text.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,29 @@
.e-content,
.edit-indicator__content,
.reply-indicator__content {
code {
background: var(--rich-text-container-color);
padding: 4px;
border-radius: 4px;
color: var(--rich-text-text-color);
font-size: 0.85em;
}

pre {
background: var(--rich-text-container-color);
padding: 8px;
border-radius: 4px;
color: var(--rich-text-text-color);

code {
padding: 0;
background: transparent;
}
}

pre,
blockquote {
margin-bottom: 20px;
margin-bottom: 22px;
white-space: pre-wrap;
unicode-bidi: plaintext;

Expand All @@ -14,19 +34,45 @@
}

blockquote {
padding-inline-start: 10px;
border-inline-start: 3px solid $darker-text-color;
color: $darker-text-color;
padding-inline-start: 32px;
color: var(--rich-text-text-color);
white-space: normal;
position: relative;

&::before {
display: block;
content: '';
width: 24px;
height: 20px;
mask-image: url('~images/quote.svg');
background-color: var(--rich-text-decorations-color);
position: absolute;
inset-inline-start: 0;
top: 0;
}

blockquote {
margin-top: 4px;
border-inline-start: 3px solid var(--rich-text-decorations-color);
padding-inline-start: 16px;

&::before {
display: none;
}
}

p:last-child {
p:last-of-type {
margin-bottom: 0;
}
}

& > ul,
& > ol {
margin-bottom: 20px;
margin-bottom: 22px;

&:last-child {
margin-bottom: 0;
}
}

h1,
Expand Down Expand Up @@ -76,15 +122,27 @@

ul,
ol {
margin-inline-start: 2em;
padding-inline-start: 24px;

li {
padding-inline-start: 8px;

&::marker {
text-align: end;
}
}

p {
margin: 0;
}
}

ul {
list-style-type: disc;
list-style-type: '';

li::marker {
text-align: start;
}
}

ol {
Expand Down
3 changes: 3 additions & 0 deletions app/javascript/flavours/glitch/styles/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,7 @@ $dismiss-overlay-width: 4rem;
--error-background-color: #{darken($error-red, 16%)};
--error-active-background-color: #{darken($error-red, 12%)};
--on-error-color: #fff;
--rich-text-container-color: rgba(87, 24, 60, 100%);
--rich-text-text-color: rgba(255, 175, 212, 100%);
--rich-text-decorations-color: rgba(128, 58, 95, 100%);
}

0 comments on commit 227bf77

Please sign in to comment.