summaryrefslogtreecommitdiff
path: root/node_modules/doiuse/data/features/css-scroll-timeline.js
blob: 48da61cd528ef7629c2ee9d0790c5254eeda483a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/**
 * CSS @scroll-timeline
 * CSS property that allows animations to be driven by a container's scroll position
 * @see https://caniuse.com/css-scroll-timeline
 */

import { checkAtRule } from '../../utils/util.js';

const checkAt = checkAtRule('scroll-timeline');

/**
 * @type {import('../features').Feature}
 */
export default (node) => {
  // check for @scroll-timeline
  if (checkAt(node)) {
    return true;
  }

  // check for animation-timeline
  if (node.type !== 'decl') return false;
  if (node.prop.startsWith('animation-timeline')) {
    return true;
  }

  return false;
};