Guest User

Untitled

a guest
May 22nd, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. CSS.registerProperty({
  2. name: '--animation-duration',
  3. syntax: '<time>',
  4. inherits: false,
  5. initialValue: '1s'
  6. });
  7.  
  8. .my-el {
  9. --animation-duration: 1.5s;
  10. }
  11.  
  12. const duration = CSSNumericValue.parse(getComputedStyle(el).getPropertyValue('--ripple-anim-duration')).to('ms').value; // 1500
  13.  
  14. const duration = properties.get('--ripple-anim-duration').to('ms').value; // 1500
  15.  
  16. const duration = el.attributeStyleMap.get('--ripple-anim-duration').to('ms').value; // ¯_(ツ)_/¯
Add Comment
Please, Sign In to add comment