From de36e3c3b81f19cbb6e8fa58638aae889f4101b7 Mon Sep 17 00:00:00 2001 From: rhenck <richard.henck@iqb.hu-berlin.de> Date: Thu, 25 Nov 2021 17:49:23 +0100 Subject: [PATCH] Fix text element with background color and text color at the same time Highlighted (background colored) text is done with mark elements which don't have a color and make the contained text lose the styling of the parent span, which has the text-color property. To solve it we simply inherit the color of the parent span. --- projects/common/element-components/text.component.ts | 3 ++- .../properties-panel/element-model-properties.component.css | 4 ++++ .../editor/src/app/text-editor/rich-text-editor.component.css | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/projects/common/element-components/text.component.ts b/projects/common/element-components/text.component.ts index fae93df0e..93a228cef 100644 --- a/projects/common/element-components/text.component.ts +++ b/projects/common/element-components/text.component.ts @@ -67,7 +67,8 @@ import { ValueChangeElement } from '../models/uI-element'; '::ng-deep .text-container h1 {font-weight: bold; font-size: 20px;}', '::ng-deep .text-container h2 {font-weight: bold; font-size: 18px;}', '::ng-deep .text-container h3 {font-weight: bold; font-size: 16px;}', - '::ng-deep .text-container h4 {font-weight: normal; font-size: 16px;}' + '::ng-deep .text-container h4 {font-weight: normal; font-size: 16px;}', + 'mark {color: inherit}' ] }) export class TextComponent extends ElementComponent { diff --git a/projects/editor/src/app/components/unit-view/page-view/properties-panel/element-model-properties.component.css b/projects/editor/src/app/components/unit-view/page-view/properties-panel/element-model-properties.component.css index 3166662cb..766fe0618 100644 --- a/projects/editor/src/app/components/unit-view/page-view/properties-panel/element-model-properties.component.css +++ b/projects/editor/src/app/components/unit-view/page-view/properties-panel/element-model-properties.component.css @@ -53,3 +53,7 @@ font-weight: normal; font-size: 16px; } + +mark { + color: inherit; +} diff --git a/projects/editor/src/app/text-editor/rich-text-editor.component.css b/projects/editor/src/app/text-editor/rich-text-editor.component.css index 6a9212b87..c19be7bdd 100644 --- a/projects/editor/src/app/text-editor/rich-text-editor.component.css +++ b/projects/editor/src/app/text-editor/rich-text-editor.component.css @@ -87,3 +87,7 @@ app-rich-text-editor .editor-controls-second-line { .special-chars-button { margin-left: 25px; } + +mark { + color: inherit; +} -- GitLab