-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CIVIC-1295] Added content components support for CKEditor. (#1156)
* [CIVIC-1295] fix ckeditor5 styles * [CIVIC-1295] refactored the import * [CIVIC-1295] added more comment * [CIVIC-1295] imported color variables * [CIVIC-1295] fix linting and remove unused extend statement * [CIVIC-1295] updated the storybook for editor-content * Removed editor styles component from UI Kit. * Fixed links not being styled by default in Basic content component. * Fixed editor styles not being applied in Drupal. * Added colours variables to ckeditor. --------- Co-authored-by: Alex Skrypnyk <alex@drevops.com>
- Loading branch information
1 parent
a2cb391
commit c92df24
Showing
16 changed files
with
110 additions
and
218 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
web/themes/contrib/civictheme/assets/sass/theme.editor.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// Editor styles. | ||
// | ||
// stylelint-disable scss/at-import-partial-extension | ||
|
||
// Import only required partials to minimize CSS output. | ||
@import 'components/00-base/variables'; | ||
@import 'components/00-base/**/mixins/*.scss'; | ||
@import 'components/00-base/**/fonts'; | ||
|
||
.ck-editor__editable { | ||
@include ct-content(); | ||
@include ct-content-light(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
...themes/contrib/civictheme/civictheme_library/components/00-base/mixins/_content-link.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// | ||
// Content Link mixins. | ||
// | ||
|
||
@mixin ct-content-link-base() { | ||
text-decoration: underline; | ||
text-decoration-thickness: ct-particle(0.25); | ||
text-underline-offset: ct-particle(0.375); | ||
padding: ct-spacing(0.375) 0 ct-spacing(0.25); | ||
word-break: break-word; | ||
|
||
&:hover { | ||
text-decoration: none; | ||
padding: ct-spacing(0.375) 0 ct-spacing(0.5); | ||
} | ||
|
||
&, | ||
&.ct-theme-light { | ||
color: $ct-content-link-light-color; | ||
|
||
&:focus { | ||
@include ct-outline(); | ||
} | ||
|
||
&:hover { | ||
background-color: $ct-content-link-light-hover-background-color; | ||
color: $ct-content-link-light-hover-color; | ||
} | ||
} | ||
|
||
&.ct-theme-dark { | ||
color: $ct-content-link-dark-color; | ||
|
||
&:focus { | ||
@include ct-outline(true); | ||
} | ||
|
||
&:hover { | ||
background-color: $ct-content-link-dark-hover-background-color; | ||
color: $ct-content-link-dark-hover-color; | ||
} | ||
} | ||
|
||
&:visited { | ||
@include ct-content-link-visited(); | ||
} | ||
} | ||
|
||
@mixin ct-content-link-visited() { | ||
$root: &; | ||
|
||
@include ct-component-theme($root) using($root, $theme) { | ||
color: ct-component-var($root, $theme, visited, color); | ||
|
||
&:hover { | ||
@include ct-component-property($root, $theme, visited, hover, border-color); | ||
@include ct-component-property($root, $theme, visited, hover, color); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,6 +91,10 @@ | |
} | ||
} | ||
|
||
a { | ||
@include ct-content-link-base(); | ||
} | ||
|
||
blockquote { | ||
@include ct-typography('quote'); | ||
|
||
|
66 changes: 1 addition & 65 deletions
66
.../contrib/civictheme/civictheme_library/components/01-atoms/content-link/content-link.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
111 changes: 0 additions & 111 deletions
111
...theme/civictheme_library/components/02-molecules/editor-content/editor-content.stories.js
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
...eme/civictheme_library/components/02-molecules/editor-content/editor-content.stories.scss
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
web/themes/contrib/civictheme/civictheme_library/components/style.editor.scss
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
web/themes/contrib/civictheme/civictheme_starter_kit/assets/sass/editor/_index.scss
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
web/themes/contrib/civictheme/civictheme_starter_kit/assets/sass/theme.editor.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// Editor styles. | ||
// | ||
// stylelint-disable scss/at-import-partial-extension | ||
|
||
// Import only required partials to minimize CSS output. | ||
@import 'components_combined/00-base/variables'; | ||
@import 'components_combined/00-base/**/mixins/*.scss'; | ||
@import 'components_combined/00-base/**/fonts'; | ||
|
||
.ck-editor__editable { | ||
@include ct-content(); | ||
@include ct-content-light(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters