Comments (7)
I'd love to support this. I wonder if detecting that the document is using RTL and changing the animation direction automatically would work? E.g. by using https://developer.mozilla.org/en-US/docs/Web/CSS/:dir
from react-loading-skeleton.
It will change only the element direction and not the animation
from react-loading-skeleton.
Since are you using animation CSS property, the only way to change the animation direction is to use animation-direction property.
Right now we can set that only on Skeleton
component using className
/style
properties which will be repetitive if you are using many Skeleton
components.
A better way to deal with that in my opinion is to set a new property (direction
) on SkeletonTheme component and change the animation-direction
value from normal
to reverse
according to direction
value (rtl
/ltr
).
from react-loading-skeleton.
Ah sorry I didn't explain my idea well. I meant that we can modify the library so that it already comes with CSS that detects if a skeleton is in a rtl document (or section), and if so apply animation-direction: reverse
by itself. This would maintain the ethos that the skeleton should automatically adapt to the contents of your page, rather than having to manually specify the direction in some another way. It seems that the :dir
pseudo-selector I mentioned earlier has limited browser support, but if your page is using the dir
HTML attribute then we could still make the idea work.
from react-loading-skeleton.
I opened a PR for it @dvtng #78, hopefully it will work
from react-loading-skeleton.
Hello @saadaouad @dvtng last open PR looks good to me, please merge it and issue will be fixed, we are waiting for rtl props to skeletontheme, Thanks!!
from react-loading-skeleton.
I had fixed this issue with this
${({theme:{isRTL}}) => isRTL && css`
.react-loading-skeleton {
animation-direction: reverse;
}
`}
from react-loading-skeleton.
Related Issues (20)
- Fill wrapping container HOT 3
- Module not found
- Typescript: Not compatible with config "moduleResolution": "nodenext" HOT 7
- TypeError: Property description must be an object: count at defineProperties HOT 4
- Animation isn't working since 3.2 HOT 3
- Version 3.3.0 contains breaking changes compared to 3.2.0 HOT 1
- Not working with nextjs loading.tsx HOT 6
- Synchronous import not allowed HOT 6
- create a library and import react-loading-skeleton, and then used this lib into another lib throws erorr HOT 1
- Typescript complains in CJS modules after 3.3.0 (nodenext module resolution)
- i have npm v18 and skeleton loading animation is not working with me please any help HOT 4
- Error: Hydration failed because the initial UI does not match what was rendered on the server. HOT 1
- Inline is not removing br HOT 1
- How to create a skeleton for a img tag
- FEAT REQ - highlight width HOT 1
- Skeletons occlude other elements because of z-index HOT 1
- v3.4.0 available on NPM but not in repo. Legit release? HOT 2
- baseColor not working HOT 1
- Dark theme animation not visible HOT 3
- `hidden` prop does not work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-loading-skeleton.