Code Monkey home page Code Monkey logo

Comments (7)

dvtng avatar dvtng commented on July 18, 2024

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.

saadaouad avatar saadaouad commented on July 18, 2024

It will change only the element direction and not the animation

from react-loading-skeleton.

saadaouad avatar saadaouad commented on July 18, 2024

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.

dvtng avatar dvtng commented on July 18, 2024

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.

saadaouad avatar saadaouad commented on July 18, 2024

I opened a PR for it @dvtng #78, hopefully it will work

from react-loading-skeleton.

jaril5976 avatar jaril5976 commented on July 18, 2024

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.

jaril5976 avatar jaril5976 commented on July 18, 2024

I had fixed this issue with this

${({theme:{isRTL}}) => isRTL && css`
    .react-loading-skeleton {
      animation-direction: reverse;
    }
  `}

from react-loading-skeleton.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.