Guest User

Untitled

a guest
Aug 10th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. /* Scoped Style */
  2. @supports (--js-element('html', {}, {})) {
  3. [--self] {
  4. background: cyan;
  5. }
  6. }
  7.  
  8. /* Using an Element Query */
  9. @supports (--js-element('html', {minWidth: 500}, {})) {
  10. [--self] {
  11. background: magenta;
  12. }
  13. }
  14.  
  15. /* Testing a Property with a Function */
  16. @supports (--js-element('html', {offsetWidth: n => n > 700}, {})) {
  17. [--self] {
  18. background: yellow;
  19. }
  20. }
  21.  
  22. /* Using a Custom Function */
  23. @supports (
  24. --js-element(
  25. 'html',
  26. {customFunc: 900},
  27. {customFunc: (tag, n) => tag.offsetWidth > n}
  28. )
  29. ) {
  30. [--self] {
  31. background: black;
  32. }
  33. }
Add Comment
Please, Sign In to add comment