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

How about supporting extra prop for outlined shape #266

Closed
liam61 opened this issue Nov 11, 2021 · 2 comments
Closed

How about supporting extra prop for outlined shape #266

liam61 opened this issue Nov 11, 2021 · 2 comments

Comments

@liam61
Copy link
Contributor

liam61 commented Nov 11, 2021

What did you do?

Hi, this project is awesome
I use it to generate skeleton for web pages
However, when it comes to card shape skeleton with a border, content-loader could not build a outlined shape, such as
image

What did you expect to happen?

provide props for outline shape feature, generate rect before rect[role="presentation"] element, like

<svg aria-labelledby="yg04wy8-aria" role="img" width="350" height="100" viewBox="0 0 350 100" xmlns="http://www.w3.org/2000/svg" version="1.1">
  <title id="yg04wy8-aria">Loading...</title>
  <!-- here outline goes -->
  <rect width="306" height="86" rx="4" ry="4" stroke="#DEE0E3" stroke-width="1" fill="#fff" y="1" x="1"></rect>
  <rect role="presentation" x="0" y="0" width="100%" height="100%" clip-path="url(#yg04wy8-diff)" style="fill: url(&quot;#yg04wy8-animated-diff&quot;);"></rect>
  <defs>
    <clipPath id="yg04wy8-diff"><rect x="12" y="61" rx="4" ry="4" width="282" height="12"></rect><rect x="40" y="16" rx="4" ry="4" width="80" height="14"></rect><rect x="12" y="41" rx="4" ry="4" width="282" height="12"></rect><rect x="12" y="13" rx="4" ry="4" width="20" height="20"></rect></clipPath>
    <linearGradient id="yg04wy8-animated-diff"><stop offset="0%" stop-color="#f3f3f3" stop-opacity="1"><animate attributeName="offset" values="-2; -2; 1" keyTimes="0; 0.25; 1" dur="3s" repeatCount="indefinite"></animate></stop><stop offset="50%" stop-color="#ecebeb" stop-opacity="1"><animate attributeName="offset" values="-1; -1; 2" keyTimes="0; 0.25; 1" dur="3s" repeatCount="indefinite"></animate></stop><stop offset="100%" stop-color="#f3f3f3" stop-opacity="1"><animate attributeName="offset" values="0; 0; 3" keyTimes="0; 0.25; 1" dur="3s" repeatCount="indefinite"></animate></stop></linearGradient>
  </defs>
</svg>
@danilowoz
Copy link
Owner

danilowoz commented Nov 14, 2021

Hey @lawler61, very interesting issue; thanks for raising this question.
However, I'm wondering how many people have faced this issue before or would still face it. Maybe it's worth creating your own custom solution (like you did) instead of the package solving it and shipping more extra code to everybody else. Did you see my point?

Despite this point, how would you propose this change in the package? I'm thinking something like this:

<ContentLoader beforeMask={<rect ... />}>
  // children
</ContentLoader>

Thanks once again, curious to hear your thoughts

@liam61
Copy link
Contributor Author

liam61 commented Nov 15, 2021

@danilowoz It is a nice idea, and �I'll try and put some pr the other day

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

2 participants