question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Skeleton] Invisible against a dark background

See original GitHub issue
  • [x ] I have searched the issues of this repository and believe that this is not a duplicate.

Summary 💡

The Skeleton component only supports one rendering colour, and if placed over a dark background is invisible.

Motivation 🔦

I am using a text variant Skeleton on a dark grey background, but it can’t be viewed. It would be nice if it supported a light variant.

I’m not sure if this is best done through a dark/light toggle, or perhaps through the color property? In my use case it is a child of an AppBar so could perhaps support color="inherit" to
know that I’m using a dark AppBar as other child components do.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

7reactions
Sinan-privatecommented, Apr 14, 2020

I don’t think using a Mui Component in a dark theme is a niche use case. I am currently having the same issue.

2reactions
oliviertassinaricommented, Feb 23, 2021

A demo of how the customization can be done in v5:

import * as React from "react";
import Box from "@material-ui/core/Box";
import Skeleton from "@material-ui/core/Skeleton";

export default function Variants() {
  return (
    <Box sx={{ bgcolor: "#000", p: 8 }}>
      <Skeleton sx={{ bgcolor: "grey.900" }} variant="text" />
      <Skeleton
        sx={{ bgcolor: "grey.900" }}
        variant="circular"
        width={40}
        height={40}
      />
      <Skeleton
        sx={{ bgcolor: "grey.900" }}
        variant="rectangular"
        width={210}
        height={118}
      />
    </Box>
  );
}

https://codesandbox.io/s/variants-material-demo-forked-5xfd6?file=/demo.tsx:0-556

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Skeleton] Invisible against a dark background #19957
The Skeleton component only supports one rendering colour, and if placed over a dark background is invisible.
Read more >
React Skeleton component - Material UI - MUI
This is especially useful when on a black background (as the skeleton will otherwise be invisible).
Read more >
Scientists "Zoom In" On Dark Matter, Revealing the Invisible ...
Although the images of dark matter haloes from this study are the result of simulations, the simulations themselves are informed by real observational...
Read more >
Crazy Bonez Pose-N-Stay Skeleton - Amazon.com
The spine, hips and locking knees support itself when leaning against ... Pose-N-Stay skeleton features an invisible coating of glow in the dark...
Read more >
How to Kill All Skeleton Types in Sea of Thieves - Shacknews
Shadow Skeleton. The shadow skeletons (sometimes called ghosts, spectral or ethereal skeletons) are black, misty skeletons that look all foggy ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found