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

Typography should have a textShadow prop #22306

Closed
1 task done
kanguyen-vn opened this issue Aug 22, 2020 · 6 comments
Closed
1 task done

Typography should have a textShadow prop #22306

kanguyen-vn opened this issue Aug 22, 2020 · 6 comments
Labels
component: Typography The React component. support: Stack Overflow Please ask the community on Stack Overflow

Comments

@kanguyen-vn
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

Summary 💡

Right now there is no easy/intuitive way to add textShadow to a Typography, if even any.

Examples 🌈

Example in simple HTML and CSS:

image

Motivation 🔦

I am working on a web project and the aesthetic I am going for is a simple boxShadow for every element, but the main header of the homepage is a Typography, and it is the only thing without a shadow and it's not consistent to the styling of the whole project.

image

@kanguyen-vn kanguyen-vn added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 22, 2020
@oliviertassinari oliviertassinari marked this as a duplicate of #15551 Aug 22, 2020
@oliviertassinari oliviertassinari added duplicate This issue or pull request already exists component: Typography The React component. support: Stack Overflow Please ask the community on Stack Overflow and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer duplicate This issue or pull request already exists labels Aug 22, 2020
@support
Copy link

support bot commented Aug 22, 2020

👋 Thanks for using Material-UI!

We use GitHub issues exclusively as a bug and feature requests tracker, however,
this issue appears to be a support request.

For support, please check out https://material-ui.com/getting-started/support/. Thanks!

If you have a question on StackOverflow, you are welcome to link to it here, it might help others.
If your issue is subsequently confirmed as a bug, and the report follows the issue template, it can be reopened.

@oliviertassinari
Copy link
Member

You can apply the text shadow globally with the theme.typography.

@kanguyen-vn
Copy link
Author

kanguyen-vn commented Aug 22, 2020

@oliviertassinari

I have tried that but it still doesn't work.

Here is my theme.typography:

const theme = createMuiTheme({
// the rest
typography: {
fontFamily: "Inter",
textShadow: "5px 5px 0px 0px rgba(0,0,0,0.15)",
},
});

I even tried applying the textShadow straight to the Typography using makeStyles/withStyles, but there are still no shadows. When I tried boxShadow, it output a shadow of the rectangle surrounding the Typography but not the text itself. I don't see any documentation on the website for this either, nor do I see a shadow prop in the default theme.typography.

@oliviertassinari
Copy link
Member

const theme = createMuiTheme({
  typography: {
    fontFamily: "Inter",
    allVariants: {
      textShadow: "5px 5px 0px 0px rgba(0,0,0,0.15)",
    },
  },
});

@kanguyen-vn
Copy link
Author

const theme = createMuiTheme({
  typography: {
    fontFamily: "Inter",
    allVariants: {
      textShadow: "5px 5px 0px 0px rgba(0,0,0,0.15)",
    },
  },
});

I apologize if this is becoming a support post, but that still is not working for me either. I've tried that in both the createMuiTheme and the makeStyles.

@kanguyen-vn
Copy link
Author

@oliviertassinari
Sorry for bothering you again, but do you think there is another alternative to the above solution? It didn't work when I tried it on my project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Typography The React component. support: Stack Overflow Please ask the community on Stack Overflow
Projects
None yet
Development

No branches or pull requests

2 participants