-
Notifications
You must be signed in to change notification settings - Fork 2
BP-1293: Add theming support to new rich-text editor for basic redactor configuration #240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jovana-marceta
wants to merge
28
commits into
master
Choose a base branch
from
features/BP-1293-Add-theming-support-to-rich-text-editor
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
94a3604
BP-1293: Adding Redactor overrides in entry
jovana-marceta 19895ee
BP-1293: Extending redactor generator mixins
jovana-marceta 1196aa4
BP-1293: Add redactor generators for buttons and table styles
jovana-marceta 162bab4
BP-1293: Adding redactor checkboxes generator
jovana-marceta 0444e4e
BP-1293: Refactoring redactor styles
jovana-marceta 71f0a1c
Use mixin for row coloring from foundation
jovana-marceta 6f32991
BP-1293: Inherit angular material checkbox background and change alia…
d58d056
Rename redactor lib
jovana-marceta 22133a9
Move non-theming related variables outside of redactor mixins
jovana-marceta dead72d
BP-1293: Add redactor layout generator and clean up generator file
jovana-marceta 6768b1a
BP-1293: Inherit table even background from angular material
jovana-marceta 80792fb
BP-1293: Inherit material body text color
jovana-marceta f4151f9
BP-1293: Make redactor typography generator more redeable
jovana-marceta b9f241c
BP-1293: Rename folder
jovana-marceta 8d2d02d
BP-1293: Resolve review suggestions
jovana-marceta 5a54b11
BP-1293: Get rid of variables
jovana-marceta 194e84e
rename checkbox variables
jovana-marceta 2bdd9ea
rename toolbar generator
jovana-marceta 6977b0b
BP-1293: Add missing sign on buttons generator variable
jovana-marceta d4dda13
BP-1293: Get rid of checkboxes duplicated extraction
jovana-marceta 0789b8f
Get rid of toolbar generator duplicated extraction retrieval
jovana-marceta 608e968
Additional buttons and checkboxes file refactoring
jovana-marceta b4ea198
Make buttons generator more redeable
jovana-marceta 2bb570a
Refactoring checkbox and toolbar generator
jovana-marceta 2102dcc
Fixed indentation for buttons generator
jovana-marceta 4380c1b
Merge branch 'master' of https://github.com/enigmatry/entry-angular-b…
Cvetanovic 5adf203
stylelint fixes
Cvetanovic 1243f87
comment fixes
Cvetanovic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
22 changes: 22 additions & 0 deletions
22
libs/entry-components/styles/modules/vendors/redactor/_buttons-generator.scss
This file contains hidden or 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,22 @@ | ||
| @use 'sass:map'; | ||
|
|
||
| $material-button-background: #237BBB; | ||
jovana-marceta marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| @mixin generate-from($theme) { | ||
|
|
||
| $theming-buttons: map.get($theme, 'general', 'fonts', 'buttons'); | ||
|
|
||
| .enigmatry-redactor-content button { | ||
jovana-marceta marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| @if $theming-buttons { | ||
| background-color: map.get($theme, 'general', 'colors', 'primary'); | ||
| font: { | ||
| family: map.get($theming-buttons, 'family'); | ||
| size: map.get($theming-buttons, 'size'); | ||
| } | ||
| letter-spacing: map.get($theming-buttons, 'letter-spacing'); | ||
| } | ||
| @else { | ||
| background-color: $material-button-background; | ||
| } | ||
| } | ||
| } | ||
51 changes: 51 additions & 0 deletions
51
libs/entry-components/styles/modules/vendors/redactor/_generator.scss
This file contains hidden or 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,51 @@ | ||
| @use 'sass:map'; | ||
| @use 'tables-generator' as tables; | ||
| @use 'buttons-generator' as buttons; | ||
| @use 'typography-generator' as typography; | ||
|
|
||
| $redactor-checkboxes-selector: '[data-rx-type = 'todoitem'] input:checked::before'; | ||
| $default-material-checkbox: #E94887; | ||
|
|
||
| @mixin generate-from($theme) { | ||
| @include typography.generate-from($theme); | ||
| @include tables.generate-from($theme); | ||
| @include buttons.generate-from($theme); | ||
|
|
||
| $theming-colors: map.get($theme, 'general', 'colors'); | ||
| $theming-checkboxes: map.get($theme, 'general', 'checkboxes'); | ||
|
|
||
| .enigmatry-redactor-content { | ||
| .rx-main-container, .rx-toolbox-container { | ||
| @if map.get($theme, 'general', 'inputs', 'background') { | ||
| background: map.get($theme, 'general', 'inputs', 'background'); | ||
| } | ||
| @else { | ||
| background: transparent; | ||
| } | ||
| } | ||
|
|
||
| .rx-toolbar-buttons .rx-button { | ||
| &.active, &:hover { | ||
| @if map.get($theme, 'general', 'inputs', 'background') { | ||
| background: map.get($theme, 'general', 'inputs', 'background'); | ||
| } | ||
| @else { | ||
| background: transparent; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @if $theming-checkboxes { | ||
| .rx-editor #{$redactor-checkboxes-selector} { | ||
| border-color: map.get($theming-checkboxes, 'background'); | ||
| background-color: map.get($theming-checkboxes, 'background'); | ||
| } | ||
| } | ||
| @else { | ||
| .rx-editor #{$redactor-checkboxes-selector} { | ||
| border-color: $default-material-checkbox; | ||
| background-color: $default-material-checkbox; | ||
| } | ||
| } | ||
| } | ||
| } |
24 changes: 24 additions & 0 deletions
24
libs/entry-components/styles/modules/vendors/redactor/_tables-generator.scss
This file contains hidden or 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,24 @@ | ||
| @use 'sass:map'; | ||
|
|
||
| $material-odd-background: #F0F0F0; | ||
|
|
||
| @mixin row-coloring($color, $rows) { | ||
| &:nth-child(#{$rows}) { | ||
| background-color: $color; | ||
| } | ||
| } | ||
|
|
||
| @mixin generate-from($theme) { | ||
| $theming-rows: map.get($theme, 'tables', 'rows', 'odd-even-background'); | ||
|
|
||
| .enigmatry-redactor-content table tr { | ||
| @if (map.get($theme, 'tables', 'rows')) { | ||
| @include row-coloring(map.get($theming-rows, 'odd'), 'odd'); | ||
| @include row-coloring(map.get($theming-rows, 'even'), 'even'); | ||
| } | ||
| @else { | ||
| @include row-coloring($material-odd-background, 'odd'); | ||
| @include row-coloring(transparent, 'even'); | ||
| } | ||
| } | ||
| } |
42 changes: 42 additions & 0 deletions
42
libs/entry-components/styles/modules/vendors/redactor/_typography-generator.scss
This file contains hidden or 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,42 @@ | ||
| @use 'sass:map'; | ||
|
|
||
| @mixin generate-from($theme) { | ||
| $theming-fonts: map.get($theme, 'general', 'fonts'); | ||
| $redactor-th-selector: 'thead th'; | ||
|
|
||
| .enigmatry-redactor-content { | ||
| .rx-editor, .rx-content { | ||
| @if $theming-fonts { | ||
| $body-font-family: map.get($theming-fonts, 'body', 'family'); | ||
|
|
||
| font: { | ||
| family: map.get($theming-fonts, 'body', 'family'); | ||
| size: map.get($theming-fonts, 'body', 'size'); | ||
| } | ||
| letter-spacing: map.get($theming-fonts, 'body', 'letter-spacing'); | ||
|
|
||
|
||
| h1, h2, h3, h4 { | ||
| font-family: map.get($theming-fonts, 'hero-titles', 'family'); | ||
| letter-spacing: map.get($theming-fonts, 'hero-titles', 'letter-spacing'); | ||
| } | ||
|
|
||
| h5, h6 { | ||
| font-family: map.get($theming-fonts, 'titles', 'family'); | ||
| letter-spacing: map.get($theming-fonts, 'titles', 'letter-spacing'); | ||
| } | ||
|
|
||
| table { | ||
| font-size: map.get($theming-fonts, 'body', 'size'); | ||
|
|
||
| #{$redactor-th-selector} { | ||
| font-size: map.get($theme, 'tables', 'header', 'font-size'); | ||
| } | ||
| } | ||
| } | ||
| @else { | ||
| color: rgb(0 0 0 / .6); | ||
| font-family: 'Roboto', sans-serif; | ||
| } | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| @use 'core/components'; | ||
| @use 'vendors/overrides'; | ||
jovana-marceta marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or 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 @@ | ||
| @use 'overrides/redactor'; |
1 change: 1 addition & 0 deletions
1
libs/entry-components/styles/partials/vendors/overrides/_index.scss
This file contains hidden or 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 @@ | ||
| @use 'redactor'; |
21 changes: 21 additions & 0 deletions
21
libs/entry-components/styles/partials/vendors/overrides/redactor/_buttons.scss
This file contains hidden or 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,21 @@ | ||
| $material-box-shadow: 0 3px 1px -2px rgb(0 0 0 / .2), 0 2px 2px 0 rgb(0 0 0 / .14), 0 1px 5px 0 rgb(0 0 0 / .12); | ||
| $material-box-shadow-hovered: 0 2px 4px -1px rgb(0 0 0 / .2), 0 4px 5px 0 rgb(0 0 0 / .14), 0 1px 10px 0 rgb(0 0 0 / .12); | ||
jovana-marceta marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| .enigmatry-redactor-content button { | ||
| height: 36px; | ||
| margin: 8px 8px 8px 0; | ||
| padding: 0 16px; | ||
| border: none; | ||
| border-radius: 4px; | ||
| box-shadow: $material-box-shadow; | ||
| color: #FFF; | ||
| font: { | ||
| family: 'Roboto', sans-serif; | ||
| weight: 500; | ||
| size: 14px; | ||
| } | ||
|
|
||
| &:hover { | ||
| box-shadow: $material-box-shadow-hovered; | ||
| } | ||
| } | ||
19 changes: 19 additions & 0 deletions
19
libs/entry-components/styles/partials/vendors/overrides/redactor/_general.scss
This file contains hidden or 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,19 @@ | ||
| @use 'sass:map'; | ||
|
|
||
| $material-text-color: rgb(0 0 0 / .87); | ||
| $material-border: rgb(0 0 0 / .38); | ||
| $material-icon-color: rgb(0 0 0 / .54); | ||
|
|
||
| .enigmatry-redactor-content { | ||
| .rx-editor, .rx-content { | ||
| color: $material-text-color; | ||
| } | ||
|
|
||
| .rx-button-icon svg { | ||
| fill: $material-icon-color; | ||
| } | ||
|
|
||
| .rx-main-container { | ||
| border-color: $material-border; | ||
| } | ||
| } |
3 changes: 3 additions & 0 deletions
3
libs/entry-components/styles/partials/vendors/overrides/redactor/_index.scss
This file contains hidden or 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,3 @@ | ||
| @use 'general'; | ||
| @use 'tables'; | ||
| @use 'buttons'; |
28 changes: 28 additions & 0 deletions
28
libs/entry-components/styles/partials/vendors/overrides/redactor/_tables.scss
This file contains hidden or 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,28 @@ | ||
| $redactor-first-row: 'tr:first-child'; | ||
| $redactor-last-row: 'tr:last-child'; | ||
jovana-marceta marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| .enigmatry-redactor-content table { | ||
| th { | ||
| font-weight: 500; | ||
| } | ||
|
|
||
| #{$redactor-first-row} { | ||
| th, td { | ||
| border-top: none; | ||
| } | ||
| } | ||
|
|
||
| #{$redactor-last-row} td { | ||
| border-bottom: none; | ||
| } | ||
|
|
||
| th, td { | ||
| &:first-child { | ||
| border-left: none; | ||
| } | ||
|
|
||
| &:last-child { | ||
| border-right: none; | ||
| } | ||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.