Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 314b2e7

Browse files
authored
Add new style for inline code (#9936)
Add new style for inline code
1 parent 8a2e386 commit 314b2e7

File tree

7 files changed

+29
-0
lines changed

7 files changed

+29
-0
lines changed

res/css/_spacing.pcss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ limitations under the License.
1616

1717
/* 1rem :: 10px */
1818

19+
$spacing-2: 2px;
1920
$spacing-4: 4px;
2021
$spacing-8: 8px;
2122
$spacing-12: 12px;

res/css/views/rooms/_EventTile.pcss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,18 @@ $left-gutter: 64px;
551551
background-color: $codeblock-background-color;
552552
}
553553

554+
code:not(pre *) {
555+
background-color: $inlinecode-background-color;
556+
border: 1px solid $inlinecode-border-color;
557+
border-radius: 4px;
558+
// The horizontal padding is added by gfm.css .markdown-body
559+
padding: $spacing-2 0;
560+
// Avoid inline code blocks to be sticked when on multiple lines
561+
line-height: $font-22px;
562+
// Avoid the border to be glued to the other words
563+
margin-right: $spacing-2;
564+
}
565+
554566
code {
555567
white-space: pre-wrap; /* don't collapse spaces in inline code blocks */
556568
}

res/css/views/rooms/wysiwyg_composer/components/_Editor.pcss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ limitations under the License.
4949
:is(ol, ul) + br:last-of-type {
5050
display: none;
5151
}
52+
53+
code {
54+
font-family: $monospace-font-family !important;
55+
background-color: $inlinecode-background-color;
56+
border: 1px solid $inlinecode-border-color;
57+
border-radius: 4px;
58+
padding: $spacing-2;
59+
}
5260
}
5361

5462
.mx_WysiwygComposer_Editor_content_placeholder::before {

res/themes/dark/css/_dark.pcss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ $composer-shadow-color: rgba(0, 0, 0, 0.28);
224224
$breadcrumb-placeholder-bg-color: #272c35;
225225
$theme-button-bg-color: #e3e8f0;
226226
$resend-button-divider-color: rgba($header-panel-text-primary-color, 0.74);
227+
$inlinecode-border-color: $quinary-content;
228+
$inlinecode-background-color: $system;
227229
$codeblock-background-color: #2a3039;
228230
$scrollbar-thumb-color: rgba(255, 255, 255, 0.2);
229231
$selected-color: $room-highlight-color;

res/themes/legacy-dark/css/_legacy-dark.pcss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ $appearance-tab-border-color: $room-highlight-color;
190190
$composer-shadow-color: tranparent;
191191

192192
$codeblock-background-color: #2a3039;
193+
$inlinecode-border-color: #2a3039;
194+
$inlinecode-background-color: #2a3039;
193195

194196
/* Bubble tiles */
195197
$eventbubble-self-bg: #14322e;

res/themes/legacy-light/css/_legacy-light.pcss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,8 @@ $appearance-tab-border-color: $input-darker-bg-color;
290290
$composer-shadow-color: tranparent;
291291

292292
$codeblock-background-color: $header-panel-bg-color;
293+
$inlinecode-border-color: $header-panel-bg-color;
294+
$inlinecode-background-color: $header-panel-bg-color;
293295

294296
/* Bubble tiles */
295297
$eventbubble-self-bg: #f0fbf8;

res/themes/light/css/_light.pcss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ $composer-shadow-color: rgba(0, 0, 0, 0.04);
295295
$breadcrumb-placeholder-bg-color: #e8eef5;
296296
$theme-button-bg-color: $quinary-content;
297297
$resend-button-divider-color: $input-darker-bg-color;
298+
$inlinecode-border-color: $quinary-content;
299+
$inlinecode-background-color: $system;
298300
$codeblock-background-color: $header-panel-bg-color;
299301
$scrollbar-thumb-color: rgba(0, 0, 0, 0.2);
300302
$selected-color: $secondary-accent-color;

0 commit comments

Comments
 (0)