Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Material-UI Link styles #147

Closed
3 tasks done
mmaass opened this issue Jun 18, 2020 · 3 comments
Closed
3 tasks done

Material-UI Link styles #147

mmaass opened this issue Jun 18, 2020 · 3 comments

Comments

@mmaass
Copy link

mmaass commented Jun 18, 2020

Checklist

Description

Good job with the editor, we are very fond of it ❤️

I am aware of the fact that you can customise the RTE via a theme as done here (https://github.com/niuware/mui-rte/blob/master/examples/theme/index.tsx)

link-styling

As you can see in the screenshot I've attached, the styling of an actual Link (materialUI component) and a link in the MUIRichTextEditor isn't equal. Given the name of the this project I was under the assumption, that the content of the RTE would be rendered with MaterialUI styling. Instead the MaterialUI styling seems to be restricted to the Toolbar and the Popups.

Question:
Do I have to mimic MaterialUI's Link styles in a custom theme for the MUIRichTextEditor or can I override the DOM created if a Link gets inserted in the RTE. - or is there even another way I've missed so far?

Enhancement
The RTE content not being rendered with MaterialUI styles could be better communicated in the project's readme file.

@niuware
Copy link
Owner

niuware commented Jun 19, 2020

Hi @mmaass
Thanks for using the package. Indeed the Link component of the MUIRichTextEditor should be using the Link's component from material-ui. I have updated this on version 1.23.0, but as for now you won't be able to be set properties like variant, color, etc., but instead rely on a custom theme.

@niuware niuware closed this as completed Jun 19, 2020
@mortoni
Copy link

mortoni commented Oct 22, 2020

Hi @niuware,

How can I change the link color when it is visited inside custom theme?

@niuware
Copy link
Owner

niuware commented Nov 2, 2020

Hi @mortoni, you can use nested selectors:

anchorLink: {
    color: "#FF0000",
    "&:visited": {
        color: "#00FF00"
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants