Commit Graph

31 Commits

Author SHA1 Message Date
Rostislav Wolny
cd274c0738 Add basic style for buttons
Default background rendering has to be handled on the button renderer level
because of a specific markup for Outlook (bgcolor attribute). Default text color and paddings are
handled via CSS inlining. That's why they are tested in RendererTest

I used the same background color and font color as the one defined for the button
element in WP core theme.json, and I also used similar padding values
(In core they use "calc(0.667em + 2px) calc(1.333em + 2px)")
[MAILPOET-5814]
2024-01-23 16:47:48 +01:00
Rostislav Wolny
b9b57cc574 Refactor getSettings to work with the mered theme
The method was loading both themes separately. This commit changes
the behavior so that it uses only the email theme which contains
also the core theme settings.
Instead of modifying the core theme settings in PHP we can now
move these settings into the email editor theme, which is merged
into the core theme.
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
Rostislav Wolny
512d47609e Use merged theme in renderer CSS and for font-size slug translation
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
Rostislav Wolny
55dd1d0ab0 Improve getTheme to return merged core theme + email theme
The idea is that the core theme is a base and we add email-specific
modifications on top of and create a core email theme.
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
Rostislav Wolny
0e04a892c2 Inline style declaration from font-size classes
This is needed for cases where we don't touch the HTML output
to insert font size from the preprocessor (e.g., list item)
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
Rostislav Wolny
a472df257a Replace font size slugs with values in typography preprocessor
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
Rostislav Wolny
2573042431 Remove default content styles
These are no longer needed.
I also found that the settings for font-size for headings were
not used anywhere.
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
Rostislav Wolny
c4586d60e9 Move the default font family and font size settings to the theme.json
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
Rostislav Wolny
e8bb1b5ac0 Refactor font family rendering using CSS inlining
We don't reset font family on any level, so there is no need to
bubble the setting using a preprocessor and render the inline styles
explicitly in every block.

In this commit, I change how font-family settings are distributed/rendered
in the email renderer. In the new approach, we rely on class names defining font-family
and a generated CSS sheet with font-family definitions.
We apply the font-family CSS by inlining CSS rules for families in the later phase of
rendering after all individual blocks are processed.
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
Rostislav Wolny
429f0ce081 Enable font family selection in email editor
Initially, we use just basic serif and sans serif fonts.
[MAILPOET-5740]
2024-01-23 16:47:48 +01:00
Pavel Dohnal
db9813a3aa Remove gradients from the new email editor
[MAILPOET-5824]
2024-01-19 13:13:27 +01:00
Rostislav Wolny
9b05e46690 Use theme.json defined background in renderer
[MAILPOET-5644]
2024-01-08 09:21:16 +01:00
Rostislav Wolny
c5ad2405aa Add Flex Renderer test
[MAILPOET-5644]
2024-01-08 09:21:16 +01:00
Rostislav Wolny
2032370f03 Add default core editor styles
We accidentally removed them when adding layout styles.
[MAILPOET-5644]
2024-01-08 09:21:16 +01:00
Rostislav Wolny
bfa7b509cc Add buttons block rendering
[MAILPOET-5644]
2024-01-08 09:21:16 +01:00
Rostislav Wolny
6807189df3 Enable border-related settings in the email editor
[MAILPOET-5644]
2024-01-08 09:21:16 +01:00
Rostislav Wolny
3a74c1c4a0 Enable blocks and register dummy button/buttons renderers
[MAILPOET-5644]
2024-01-08 09:21:16 +01:00
Jan Lysý
37d893ff47 Disable fontWeight settings for Paragraphs
[MAILPOET-5642]
2024-01-05 10:17:23 +01:00
Jan Lysý
52214962a6 Disable dropCap settings for Paragraphs
[MAILPOET-5642]
2024-01-05 10:17:23 +01:00
Jan Lysý
6ec1a46492 Add theme.json containing padding and email width
I used theme.json for generating classes useful for full-width in the email editor.
[MAILPOET-5688]
2023-12-21 13:04:10 +01:00
Jan Lysý
a854c3407a Enable alignWide in BlockEditor
[MAILPOET-5688]
2023-12-21 13:04:10 +01:00
Jan Lysý
aa40d7eb7b Set BlockList layout
[MAILPOET-5688]
2023-12-21 13:04:10 +01:00
Jan Lysý
7792331999 Add rendering improvements for Outlook
[MAILPOET-5705]
2023-11-27 12:54:30 +01:00
Jan Lysý
328fcfa260 Move method for composing styles to SettingsController
To avoid repetition I decided to move this method to better place.
[MAILPOET-5705]
2023-11-27 12:54:30 +01:00
Oluwaseun Olorunsola
0d771a7fc5 Add support for creating styles from block attributes e.g., text alignment styles
MAILPOET-5643
2023-11-17 09:49:06 +01:00
Rostislav Wolny
5eb9551d28 Load and apply layout styles in the email editor
This commit enables us to load styles for editor content.
The rules are prefixed by .editor-styles-wrapper class
[MAILPOET-5715]
2023-11-16 13:51:24 +01:00
Jan Lysý
1b73e0f4db Allow core/list, core/list-item blocks in email editor
[MAILPOET-5645]
2023-11-11 09:38:35 +04:00
Jan Lysý
5644cab9e3 Refactor BlocksRegistry to pass dependencies as an argument
For better extensibility of 3rd party developers, I refactored to pass Settings Controller as an argument.
[MAILPOET-5591]
2023-11-09 09:06:33 +01:00
Jan Lysý
0ac72d43e6 Merge StylesController to SettingsController
[MAILPOET-5591]
2023-11-09 09:06:33 +01:00
Rostislav Wolny
9f0e015f44 Load core editor setting as the base settings for the email editor
[MAILPOET-5660]
2023-10-26 10:43:00 +02:00
Rostislav Wolny
399ed61503 Introduce SettingsController for managing editor settings
[MAILPOET-5637]
2023-10-17 16:06:06 +02:00