Bug #100768
closedEpic #99669: CKEditor5 Collection
CKEditor 5: Incorrect webfont path in backend
100%
Description
After TYPO3 Upgrade to TYPO3 v12 LTS the webfonts in the RTE/CKEditor v5 not working well.
In Frontend it works well.
Composer Installation
CSS File frontend and rte.css
@font-face {
font-family: "roboto_condensedregular";
src: url("../../Fonts/robotocondensed-regular-webfont.eot");
src: url("../../Fonts/robotocondensed-regular-webfont.eot?#iefix") format("embedded-opentype"), url("../../Fonts/robotocondensed-regular-webfont.woff2") format("woff2"), url("../../Fonts/robotocondensed-regular-webfont.woff") format("woff"), url("../../Fonts/robotocondensed-regular-webfont.ttf") format("truetype"), url("../../Fonts/robotocondensed-regular-webfont.svg#roboto_condensedregular") format("svg");
font-weight: normal;
font-style: normal;
}
Frontend file path
CSS: https://www.domainname.tld/_assets/40bdfa44c70e4b3480c28be680c2f7f2/Css/Dist/styles.css?1682583229
-> Working
Webfonts: https://www.domainname.tld/typo3/Fonts/robotocondensed-regular-webfont.woff2
-> Wrong - Not working
I think the generated RTE css should also be in "_assets" to work probably with other assets like webfonts...
Best regards
Sam
Updated by Oliver Hader over 1 year ago
CKEditor5 requires custom CSS to be prefixed with a .ck-content
class, the stylesheet
endpoint is automatically adding this to a given stylesheet resource with an additional element identifier (there might be multiple different RTEs in the backend, having different stylesheet definitions).
Thus, stylesheets for CKEditor5 are dynamic. Please use a separate stylesheet file (e.g. rte.css
) for the sake of being used the backend CKEditor5 & adjust it's path names.
As an alternative, it might be possible to introduce another staticContentsCss
for assets that were prefixed manually with the .ck-content
class.
Updated by Oliver Hader over 1 year ago
- Status changed from New to Needs Feedback
Updated by Samuel Heinz over 1 year ago
Hey Oli, thx for the feedback.
Current folder structure:
/vendor/namespace/sitepackage/Resources/Public/Fonts/robotocondensed-regular-webfont.eot (and other font files)
/vendor/namespace/sitepackage/Resources/Public/Css/Dist/styles.css (frontend css)
/vendor/namespace/sitepackage/Resources/Public/Css/Dist/rte.css (editor css)
Both css files have the same webfont syntax and implementation which works in CKEditor v4 very well.
editor:
config:
contentsCss: "EXT:sitepackage/Resources/Public/Css/Dist/rte.css"
Whats the recommended implementation for webfonts in rte.css? Can't access the dynamic generated path like "/_assets/40bdfa44c70e4b3480c28be680c2f7f2/Fonts/robotocondensed-regular-webfont.eot"
Best regards
Sam
Updated by Alexander Wende over 1 year ago
There is a workarround since TYPO3 12.3.
You can use https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.3/Feature-100232-LoadAdditionalStylesheetsInTYPO3Backend.html to load the backend font definitions.
Just move the font definitions from rte.css to e.g. backend.css. Then use include backend.css in additional.php settings like:
$GLOBALS['TYPO3_CONF_VARS']['BE']['stylesheets'][my_extension]= 'EXT:myextension/Resources/Public/Css/backend.css';
Updated by Česlav Przywara about 1 year ago
I have the same issue with version 12.4.6 and non-Composer installation. Not only webfonts, but also other assets (like background images) are affected.
Updated by Gerrit Code Review about 1 year ago
- Status changed from Needs Feedback to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81295
Updated by Gerrit Code Review about 1 year ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81295
Updated by Gerrit Code Review about 1 year ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81295
Updated by Gerrit Code Review about 1 year ago
Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81295
Updated by Gerrit Code Review about 1 year ago
Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81295
Updated by Gerrit Code Review about 1 year ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81308
Updated by Anonymous about 1 year ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset c56e2796245ae44209a73c855749dfd63cbed2ce.
Updated by Benjamin Franzke 10 months ago
- Related to Task #103151: Feature-96874-CKEditor5.html#css-styling should be updated; still claims SCSS processing added
Updated by Chris Müller 9 months ago
- Related to Task #103310: Add note about limitations of CKEditor5 CSS styling added
Updated by Ayke Halder about 2 months ago
- Related to Bug #104460: Asset ViewHelper does not take config.forceAbsoluteUrls into account added