File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# standardSQL
2+ # The distribution of websites by client that use the prefers-color-scheme:dark media query.
23
34WITH combined_data AS (
45 SELECT
@@ -8,17 +9,12 @@ WITH combined_data AS (
89 SUM (
910 CASE
1011 WHEN EXISTS (
11- SELECT 1
12- FROM
13- UNNEST(
14- JSON_EXTRACT_ARRAY(css, ' $.stylesheet.rules' )
15- ) AS rule
16- WHERE JSON_EXTRACT_SCALAR(rule, ' $.type' ) = ' media' AND
17- JSON_EXTRACT_SCALAR(
18- rule, ' $.media'
19- ) = ' (prefers-color-scheme:dark)'
20- )
21- THEN 1
12+ SELECT 1
13+ FROM UNNEST(JSON_EXTRACT_ARRAY(css, ' $.stylesheet.rules' )) AS rule
14+ WHERE JSON_EXTRACT_SCALAR(rule, ' $.type' ) = ' media' AND
15+ JSON_EXTRACT_SCALAR(rule, ' $.media' ) = ' (prefers-color-scheme:dark)'
16+ )
17+ THEN 1
2218 ELSE 0
2319 END
2420 ) OVER (PARTITION BY client, page) AS is_dark_mode_page
You can’t perform that action at this time.
0 commit comments