umbraco / Umbraco-CMS

Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
https://umbraco.com
MIT License
4.49k stars 2.69k forks source link

Wildcard RCE Styling overrides custom css styles #14325

Open madsoulswe opened 1 year ago

madsoulswe commented 1 year ago

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

8.2 - 11.4

Bug summary

Wildcard RCE Styling overrides custom when element i selected.

Selector: .umb-rte *[data-mce-selected="inline-boundary"]

Found on: https://github.com/umbraco/Umbraco-CMS/blob/contrib/src/Umbraco.Web.UI.Client/src/less/rte-content.less#L46

Change reference: 🙂 https://github.com/umbraco/Umbraco-CMS/blame/9bafdbd992534c14d8ee8fad53c700258c15b3f3/src/Umbraco.Web.UI.Client/src/less/rte-content.less#L46

https://github.com/umbraco/Umbraco-CMS/pull/6341

Example: image

When selected: image

Is the wildcard necessary? 😢

Specifics

No response

Steps to reproduce

  1. Install umbraco
  2. Create css for element, with background or background-color
  3. Add css to tinymce.

Example:

a {
    padding: 20px;
    background-color: #ff0000;
    color: #fff;
}

a.btn {
    padding: 20px;
    background-color: #ff0000;
    color: #fff;
}
  1. Create text in tinymce with this html:
    <p><a href="#" data-anchor="#">Link</a></p>
    <p> </p>
    <p><a href="#" class="btn" data-anchor="#">Button</a></p>

The element will recieve the custom styling, but when selected rte-content will override it.

.umb-rte *[data-mce-selected="inline-boundary"] {
    background:rgba(0,0,0,0.025);
    outline: 2px solid @pinkLight;
}

Expected result / actual result

Add a dark text-color when adding transparent background to element.

github-actions[bot] commented 1 year ago

Hi there @madsoulswe!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face:

madsoulswe commented 1 year ago

I think the outline is OK but the background makes it compilated

iOvergaard commented 1 year ago

Hi @madsoulswe

You are right, I don't think we need the background there. Please note that TinyMCE was updated in Umbraco 11+ so the behavior might differ between Umbraco 8-10 and 11-12.

I will mark this issue as up for grabs to allow our lovely community to contribute to getting this fixed.

github-actions[bot] commented 1 year ago

Hi @madsoulswe,

We're writing to let you know that we would love some help with this issue. We feel that this issue is ideal to flag for a community member to work on it. Once flagged here, folk looking for issues to work on will know to look at yours. Of course, please feel free work on this yourself ;-). If there are any changes to this status, we'll be sure to let you know.

For more information about issues and states, have a look at this blog post.

Thanks muchly, from your friendly Umbraco GitHub bot :-)