Skip to content
By using Twitter’s services you agree to our Cookies Use. We and our partners operate globally and use cookies, including for analytics, personalisation, and ads.
  • Home Home Home, current page.
  • About

Saved searches

  • Remove
  • In this conversation
    Verified accountProtected Tweets @
Suggested users
  • Verified accountProtected Tweets @
  • Verified accountProtected Tweets @
  • Language: English
    • Bahasa Indonesia
    • Bahasa Melayu
    • Català
    • Čeština
    • Dansk
    • Deutsch
    • English UK
    • Español
    • Filipino
    • Français
    • Hrvatski
    • Italiano
    • Magyar
    • Nederlands
    • Norsk
    • Polski
    • Português
    • Română
    • Slovenčina
    • Suomi
    • Svenska
    • Tiếng Việt
    • Türkçe
    • Ελληνικά
    • Български език
    • Русский
    • Српски
    • Українська мова
    • עִבְרִית
    • العربية
    • فارسی
    • मराठी
    • हिन्दी
    • বাংলা
    • ગુજરાતી
    • தமிழ்
    • ಕನ್ನಡ
    • ภาษาไทย
    • 한국어
    • 日本語
    • 简体中文
    • 繁體中文
  • Have an account? Log in
    Have an account?
    · Forgot password?

    New to Twitter?
    Sign up
DavidKPiano's profile
David K. 🎹
David K. 🎹
David K.  🎹
@DavidKPiano

Tweets

David K.  🎹

@DavidKPiano

Pianist and Web Developer, with a passion for animations, React, and statecharts. CSE team @Microsoft. 🎥 @keyframers 📸 http://instagram.com/davidkpianoHV 

Orlando, FL
codepen.io/davidkpiano
Joined December 2012

Tweets

  • © 2018 Twitter
  • About
  • Help Center
  • Terms
  • Privacy policy
  • Cookies
  • Ads info
Dismiss
Previous
Next

Go to a person's profile

Saved searches

  • Remove
  • In this conversation
    Verified accountProtected Tweets @
Suggested users
  • Verified accountProtected Tweets @
  • Verified accountProtected Tweets @

Promote this Tweet

Block

  • Tweet with a location

    You can add location information to your Tweets, such as your city or precise location, from the web and via third-party applications. You always have the option to delete your Tweet location history. Learn more

    Your lists

    Create a new list


    Under 100 characters, optional

    Privacy

    Copy link to Tweet

    Embed this Tweet

    Embed this Video

    Add this Tweet to your website by copying the code below. Learn more

    Add this video to your website by copying the code below. Learn more

    Hmm, there was a problem reaching the server.

    By embedding Twitter content in your website or app, you are agreeing to the Twitter Developer Agreement and Developer Policy.

    Preview

    Why you're seeing this ad

    Log in to Twitter

    · Forgot password?
    Don't have an account? Sign up »

    Sign up for Twitter

    Not on Twitter? Sign up, tune into the things you care about, and get updates as they happen.

    Sign up
    Have an account? Log in »

    Two-way (sending and receiving) short codes:

    Country Code For customers of
    United States 40404 (any)
    Canada 21212 (any)
    United Kingdom 86444 Vodafone, Orange, 3, O2
    Brazil 40404 Nextel, TIM
    Haiti 40404 Digicel, Voila
    Ireland 51210 Vodafone, O2
    India 53000 Bharti Airtel, Videocon, Reliance
    Indonesia 89887 AXIS, 3, Telkomsel, Indosat, XL Axiata
    Italy 4880804 Wind
    3424486444 Vodafone
    » See SMS short codes for other countries

    Confirmation

     

    Welcome home!

    This timeline is where you’ll spend most of your time, getting instant updates about what matters to you.

    Tweets not working for you?

    Hover over the profile pic and click the Following button to unfollow any account.

    Say a lot with a little

    When you see a Tweet you love, tap the heart — it lets the person who wrote it know you shared the love.

    Spread the word

    The fastest way to share someone else’s Tweet with your followers is with a Retweet. Tap the icon to send it instantly.

    Join the conversation

    Add your thoughts about any Tweet with a Reply. Find a topic you’re passionate about, and jump right in.

    Learn the latest

    Get instant insight into what people are talking about now.

    Get more of what you love

    Follow more accounts to get instant updates about topics you care about.

    Find what's happening

    See the latest conversations about any topic instantly.

    Never miss a Moment

    Catch up instantly on the best stories happening as they unfold.

    David K.  🎹‏ @DavidKPiano Apr 12

    ⚛️ Did you know that you can use CSS variables in @reactjs? Add them to the style={{...}} attribute for dynamic, customizable effects such as staggered animations:pic.twitter.com/OdKLlEpOQD

    render() {
    const { items } = this.props;

    return (
      <ul className="items">
        {items.map((item, i) => (
          <li className="item" style={{ '--i': i }}>
            Item {i}
          </li>
        ))}
      </ul>
    );
  }
    .item {
  animation: slide-left .3s both;

  /* Stagger! */
  animation-delay: calc(var(--i) * .1s);
}

@keyframes slide-left {
  from {
    transform: translateX(50%);
    opacity: 0;
  }
}
    6:59 AM - 12 Apr 2018
    • 290 Retweets
    • 1,009 Likes
    • Damien Varron Fintan Boyle tyler lee Dalton A. Mitchell Night's King Jeremy Bauer ✨ River Hohai Alison Nathan
    20 replies 290 retweets 1,009 likes
      1. New conversation
      2. David K.  🎹‏ @DavidKPiano Apr 12

        This also works for all CSS-in-JS implementations that allow CSS custom properties, such as styled-components.

        1 reply 0 retweets 11 likes
        Show this thread
      3. David K.  🎹‏ @DavidKPiano Apr 12

        Also, I forgot the key={...} attribute on each <li>, and I'm ashamed. Don't forget it.

        0 replies 1 retweet 26 likes
        Show this thread
      4. End of conversation
      1. New conversation
      2. Carson McKinstry‏ @CarsonMckinstry Apr 12
        Replying to @DavidKPiano @reactjs

        I mean, couldn't you just use a regular JS variable for that?

        2 replies 0 retweets 1 like
      3. David K.  🎹‏ @DavidKPiano Apr 12
        Replying to @CarsonMckinstry @reactjs

        Separation of concerns. What if you wanted to change the stagger interval, or modify it via media queries, or remove it for prefers-reduced-animation, or do something else with the --i var, or have different staggering behavior depending on the class, etc. etc.?

        1 reply 0 retweets 5 likes
      4. David K.  🎹‏ @DavidKPiano Apr 12
        Replying to @DavidKPiano @CarsonMckinstry @reactjs

        Think of CSS variables the same way as React props. You're delegating the responsibility of handling those props to the styles, which greatly reduces complexity and difficulty in theming, media queries, inspecting styles, etc.

        0 replies 0 retweets 9 likes
      5. End of conversation
      1. New conversation
      2. David Tuite‏ @dtuite Apr 12
        Replying to @DavidKPiano @BenMcMahen @reactjs

        Is this just importing the CSS file via webpack? How does it work? Does it work if the CSS file is extracted and loaded on the page separately?

        1 reply 0 retweets 0 likes
      3. David K.  🎹‏ @DavidKPiano Apr 12
        Replying to @dtuite @BenMcMahen @reactjs

        That's up to you. Use whatever CSS implementation you'd like.

        1 reply 0 retweets 0 likes
      4. David Tuite‏ @dtuite Apr 12
        Replying to @DavidKPiano @BenMcMahen @reactjs

        Right but how are the variables in the CSS being exposed to the JS? I didn't know that was possible. Is this just a browser feature?

        2 replies 0 retweets 1 like
      5. David K.  🎹‏ @DavidKPiano Apr 12
        Replying to @dtuite @BenMcMahen @reactjs

        You mean the CSS variables (e.g., --i)? Yes, these are modern browser features known as "CSS Custom Properties"

        0 replies 0 retweets 4 likes
      6. End of conversation
      1. New conversation
      2. Vince P‏ @TheElodin Apr 12
        Replying to @DavidKPiano @reactjs

        Holy guacamole this is so easy... and to think I would have brought in a library for something like this.pic.twitter.com/QenqvgfTxo

        1 reply 1 retweet 19 likes
      3. David K.  🎹‏ @DavidKPiano Apr 12
        Replying to @TheElodin @reactjs

        @erikras ^ here's your example!

        0 replies 0 retweets 3 likes
      4. End of conversation
      1. New conversation
      2. Oleg Isonen‏ @oleg008 Apr 12
        Replying to @DavidKPiano @reactjs

        yeah, ever css solution and every inline styles implementation can do it in every library or plain DOM. The only problem is it is not supported in IE.

        1 reply 0 retweets 3 likes
      3. David K.  🎹‏ @DavidKPiano Apr 12
        Replying to @oleg008 @reactjs

        Staggered animations are definitely a progressive enhancement. I don't mind them not working in IE.

        0 replies 0 retweets 7 likes
      4. End of conversation
      1. Cristiano Oliveira‏ @cris_o Apr 12
        Replying to @DavidKPiano @reactjs

        Great stuff --- used this here: https://medium.com/@cris_o/heatmap-from-time-series-data-with-d3js-react-tips-and-patterns-9d17a218d7f … 🤘

        0 replies 1 retweet 4 likes
        Thanks. Twitter will use this to make your timeline better. Undo
        Undo
      1. Colton Colcleasure‏ @colshacol Apr 12
        Replying to @DavidKPiano @reactjs

        Wait wait wait... What? So... I can hand off a JS value that _real_ CSS will pick up on for dynamic styling? What is this sorcery? It is amazing! This is almost the interop I've been searching for.

        0 replies 0 retweets 6 likes
        Thanks. Twitter will use this to make your timeline better. Undo
        Undo
      1. Richard Tallent ⌘‏ @richardtallent Apr 12
        Replying to @DavidKPiano @TheLarkInn @reactjs

        Yup, works in Vue as well! I recently discovered it when trying to create some configurable props for a component.

        0 replies 0 retweets 4 likes
        Thanks. Twitter will use this to make your timeline better. Undo
        Undo
      1. D∆VID Λ.‏ @meodai Apr 12
        Replying to @DavidKPiano @reactjs

        I knew, but Its pretty smart to use it for the animation delay

        0 replies 0 retweets 2 likes
        Thanks. Twitter will use this to make your timeline better. Undo
        Undo
      1. Eric McWinNEr‏ @eaprioku Apr 12
        Replying to @DavidKPiano @reactjs

        I had no idea, now that's a good reason for me to consider ReactJS instead of my beloved jQuery. So you mean like SASS variables can be used there?

        0 replies 0 retweets 1 like
        Thanks. Twitter will use this to make your timeline better. Undo
        Undo
      1. Markus Siering‏ @HerrBertling Apr 12
        Replying to @DavidKPiano @kentcdodds @reactjs

        🤯👍

        0 replies 0 retweets 1 like
        Thanks. Twitter will use this to make your timeline better. Undo
        Undo
      1. Mvsica Donvm Dei‏ @reactiveIntent Apr 12
        Replying to @DavidKPiano @reactjs

        Have not seen this in #VueJS yet

        0 replies 0 retweets 1 like
        Thanks. Twitter will use this to make your timeline better. Undo
        Undo

    Loading seems to be taking a while.

    Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.

      Promoted Tweet

      false

      • © 2018 Twitter
      • About
      • Help Center
      • Terms
      • Privacy policy
      • Cookies
      • Ads info