Project

General

Profile

Actions

Bug #18492

closed

CSS conflict with htmlarearte custom stylesheet

Added by Christopher about 16 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2008-03-22
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.1
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The RTE can be customized to display custom CSS styles in the edit window using "RTE.default.contentCSS" in page TSconfig. This is typically used to make RTE content in the BE resemble or match the styles of the website FE.

It's also possible (obviously) for skins to supply custom styles in the BE, but in the current implementation, these often incorrectly override custom RTE styles.

There is a simple method to avoid this problem. See Additional Information section below.

When RTE is enabled, the edit window is rendered in an iFrame by /typo3/alt_doc.php. The <head> section output by alt_doc.php. Just after the comment '', alt_doc.php renders three <link> elements for specific stylesheets:

1. The custom RTE stylesheet

2. the RTE's default stylesheet (/typo3/sysext/rtehtmlarea/htmlarea/skins/default/htmlarea-edited-content.css)

3. the skin-specific RTE stylesheet (/typo3/sysext/rtehtmlarea/htmlarea/skins/default/htmlarea.css)

Since e.g. the skin-specific RTE stylesheet can specify font-family styles for the body element, and since the custom RTE stylesheet is declared before this one, style declarations of equivalent specificity in the supposedly custom stylesheet will be overridden.

This problem can be addressed by making the declarations in html.css more specific (i.e. by using '!important,' the '.htmlarea-content-body' class etc), but since the RTE custom stylesheet is often the same stylesheet that is used to style FE content, it should not be necessary to make adjustments for BE styles in it.

Since the final declaration for a given selector and property will override all earlier declarations of the same property with equivalent specificity, I suggest that the CSS declarations occurs in the following order:

1. the RTE's default stylesheet (/typo3/sysext/rtehtmlarea/htmlarea/skins/default/htmlarea-edited-content.css)

2. the skin-specific RTE stylesheet (/typo3/sysext/rtehtmlarea/htmlarea/skins/default/htmlarea.css)

3. The custom RTE stylesheet

In this scenario, the RTE provides its own styles, any given skin has the option of overriding those styles, and implementation-specific RTE styles can override the previous two.
(issue imported from #M7924)


Files

rtehtmlarea_bugfix_7924.patch (3.97 KB) rtehtmlarea_bugfix_7924.patch Administrator Admin, 2008-03-24 16:04
Actions

Also available in: Atom PDF