GithubHelp home page GithubHelp logo

@keyframes get borked about uebersicht HOT 2 CLOSED

felixhageloh avatar felixhageloh commented on August 15, 2024
@keyframes get borked

from uebersicht.

Comments (2)

felixhageloh avatar felixhageloh commented on August 15, 2024 1

yeah that's a know shortcoming of the current implementation. You are right, it is because Übersicht scopes all css rules to the widget id, so that css styles don't leak across widgets. This doesn't work for keyframe animations tho. A workaround I have used in the past is to just include a style tag in your render method and put the keyframe definition in there, like:

render: -> """
  <div>
    <style>
      @-webkit-keyframes spin {
        from {
          -webkit-transform: rotate(0deg);
        }
        to {
          -webkit-transform: rotate(360deg);
        }
      }
    </style>
    <div> content goes in here </div>
  </div>
"""

You can then use the update method to insert your content and/or apply css classes to trigger the animation. The CircleCi widget has an example of that actually.

from uebersicht.

ttscoff avatar ttscoff commented on August 15, 2024

Oh, perfect. Hadn't thought of that. Thanks!

-Brett

On 20 Aug 2014, at 2:58, Felix wrote:

yeah that's a know shortcoming of the current implementation. You are
right, it is because Übersicht scopes all css rules to the widget id,
so that css styles don't leak across widgets. This doesn't work for
keyframe animations tho. A workaround I have used in the past is to
just include a style tag in your render method and put the keyframe
definition in there, like:

render: -> """
<div>
 <style>
   @-webkit-keyframes spin {
     from {
       -webkit-transform: rotate(0deg);
     }
     to {
       -webkit-transform: rotate(360deg);
     }
   }
 </style>
 <div> content goes in here </div>
</div>
"""

You can then use the update method to insert your content and/or apply
css classes to trigger the animation. The CircleCi
widget
has an
example of that actually.


Reply to this email directly or view it on GitHub:
#35 (comment)

from uebersicht.

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.