summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/system/css/components/js.module.css
blob: 645d94fa3d5d9e6382e49b02d0b19b6ab62de838 (plain) (blame)
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
28
29
30
31
32
33
34
35
/**
 * @file
 * Utility classes to assist with JavaScript functionality.
 */

/**
 * For anything you want to hide on page load when JS is enabled, so
 * that you can use the JS to control visibility and avoid flicker.
 */
.js .js-hide {
  display: none;
}

/**
 * For anything you want to show on page load only when JS is enabled.
 */
.js-show {
  display: none;
}
.js .js-show {
  display: block;
}

/**
 * Use the scripting media features for modern browsers to reduce layout shifts.
 */
@media (scripting: enabled) {
  /* Extra specificity to override previous selector. */
  .js-hide.js-hide {
    display: none;
  }
  .js-show {
    display: block;
  }
}