RichText: Enhance custom styling and formatting options - #2129
Open
UsrRian wants to merge 1 commit into
Open
Conversation
- Added `customStyles` prop to `IRichTextProps` for applying object-based formatting styles. - Introduced `IRichTextCustomFormattingStyles` interface to define styles for various rich text elements. - Updated `RichTextPropertyPane` to support custom font sizes and colors from `customStyles`. - Implemented logic to read computed styles from rendered elements to keep formatting values in sync. - Enhanced the font size dropdown to include custom sizes detected in the editor. - Merged custom color swatches for font and background colors in the color picker. - Added toggles in `ControlsTest` for enabling/disabling edit mode and custom formatting. - Updated styles in `RteColorPicker` for better visual consistency. - Added new styles for rich text actions in `ControlsTest.module.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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
customStylesprop toIRichTextPropsfor applying object-based formatting styles.IRichTextCustomFormattingStylesinterface to define styles for various rich text elements.RichTextPropertyPaneto support custom font sizes and colors fromcustomStyles.ControlsTestfor enabling/disabling edit mode and custom formatting.RteColorPickerfor better visual consistency.ControlsTest.module.scss.What's in this Pull Request?
This PR adds support for object-based custom formatting for RichText component and improves how the formatting side panel reflects actual rendered styles. It also updates docs and the ControlsTest demo so the behavior can be validated easily.
Before this change, RichText didnt have themed border on activation, when clicking on a text didnt show the actual size unless explicitly defined and didnt allow for any custom styles (yes you could apply styles by wrapping it in some div with style definitions, but those wouldnt reflect in the formating panel). Also there were couple of small things, like broken css and missing props in docs. ALso changed the rendering of the toolbar, which was placed strangely. Now editor is wrapped with "position: relative".
Tried to do as little damage as possible, to be considered for minor update.