_indicator.scss 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. @use 'sass:math';
  2. // =============================================================================
  3. // Indicator light
  4. // =============================================================================
  5. // =============================================================================
  6. // Indicator light
  7. // =============================================================================
  8. $c-indicator-size: 0.625em;
  9. $c-indicator-margin: 0.25rem;
  10. .c-indicator {
  11. display: inline-block;
  12. border-radius: 50rem;
  13. width: $c-indicator-size;
  14. height: $c-indicator-size;
  15. margin-top: -0.125rem;
  16. margin-right: $c-indicator-margin;
  17. font-size: 1rem;
  18. vertical-align: middle;
  19. }
  20. // =============================================================================
  21. // States
  22. // =============================================================================
  23. .is-absent .c-indicator {
  24. background: $color-state-absent;
  25. }
  26. .is-live .c-indicator {
  27. background: $color-state-live;
  28. }
  29. .is-draft .c-indicator {
  30. background: $color-state-draft;
  31. }
  32. // This is hipster. But it works.
  33. .is-live\+draft .c-indicator {
  34. background: $color-state-draft;
  35. position: relative;
  36. &:before {
  37. content: '';
  38. width: math.div($c-indicator-size, 2);
  39. height: $c-indicator-size;
  40. position: absolute;
  41. top: 0;
  42. left: 0;
  43. border-bottom-left-radius: 50rem;
  44. border-top-left-radius: 50rem;
  45. background: $color-state-live;
  46. transform: rotate(45deg);
  47. transform-origin: 100% 50%;
  48. }
  49. }