I am currently attempting to use the HTML Editor with the following stylesheet: <link href="_content/Radzen.Blazor/css/default-base.css" rel="stylesheet">
I am finding that the bullet points and numbered lists in the written html are being interfered with by the stylesheet provided by MudBlazor <link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet" /> so that the indentation is incorrect, or the bullet point simply doesn't appear.
Is there a way to ensure that the Radzen HTML Editor is not interfered with by other style sheets?
I'm hitting exactly the same issue as reported in this thread, but whatever I do I can't get bullets to display. Can one of you elaborate with a more detailed explanation of the fix? i.e., do I actually need anything in the /* custom bullet list styling */ part?
Also, I've noticed that the .rz-html-editor-content class isn't picked up if I use a razor.css file for my component - it only seems to kick in if I put it in the main app's CSS file. Any hints on how to workaround that? I'd really like to isolate this....
Bullet lists work by default. You probably have some other CSS which globally overrides their styling. Use your browser's developer tools to find what that is.
I've spent about 2 hours trying to solve this, but to no avail. As you say, it's MudBlazor subverting the Radzen styles, but I can't find a way to prevent it. Hoping that @Jeremy_May might be able to give some tips on how he worked around it, but in the meantime I'll have to give up.
You can use the Browser's developer tools - check the styles that apply to the <li> elements by right-clicking them and using "Inspect". The CSS rules will appear and you can toggle them one by one to see what the offender is.
Thanks, I've tried that - and untoggling the padding on the MudBlazor style seems to fix it. However, when I explicitly override the padding on the replacement style (either by setting it explicitly or using initial or revert it doesn't work. I think my CSS knowledge is lacking here.
But I've also noticed another problem - which is that the HTML becomes really messy, really quickly. If I toggle bullets in the editor on your demo page, I get a mess of HTML which is completely unusable.
I think you must be using the styles of the page itself to build/edit the html, so there's no isolation - I wouldn't expect to see the rz-editor-content variables in the HTML I export from this control. This means the control isn't practical or useful in a production environment, unfortunately, So I'll have to look elsewhere.
I can't seem to reproduce such a problem on our online demo. What should I do to get this markup?
RadzenHtmlEditor uses the built-in browser HTML editing capabilities in order to avoid rolling out a full-blown JS implementation. The actual implementation relies entirely on the browser API.
Understood. It makes sense as an approach to build a simple editor, but it means the rest of the page styles leech into the content, which is why the initial issue occurs in the first place.
To repro the problem I just did the following:
Clear any existing html
Add some bullets
On the last bullet, repeatedly toggle the bullet off / on several times
Reproduced the inline styles and will see if they can be somehow not generated. Appears to happen when a bullet is removed.
Some people require that as they need the content to look exactly as the final product in the page. Probably some sort of CSS reset applied to rz-editor-content would fix that.
Yeah, I tried a whole bunch of things, including rz-html-editor-content * { all: revert } and various stuff like that, but still found Mud and Radzen styles in the generated HTML. As you say, it's probably fine for some people - depends what they're trying to do, but it won't work for us, sadly.
Thanks for the input though, and I'll keep an eye out!
Had the same problem it's because of styles from MudBlazor setting the padding for ul and ol as 0px and list-style-type as none.
To get around it I overrode those styles as below and got it to behave as I wanted. Hope this helps someone.
<style>
.rz-html-editor-content ul {
padding-left: 20px;
}
.rz-html-editor-content ol {
padding-left: 20px;
}
.rz-html-editor-content ul li {
padding-left: 5px;
list-style-type: circle;
}
.rz-html-editor-content ol li {
padding-left: 5px;
list-style-type: decimal;
}
</style>