_components.hidecells.scss 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. // Mixins and variables
  2. @mixin transition($in) {
  3. transition:$in;
  4. -webkit-transition:$in;
  5. -moz-transition:$in;
  6. -o-transition:$in;
  7. -ms-transition:$in;
  8. }
  9. @mixin transform($in) {
  10. transform:$in;
  11. -webkit-transform:$in;
  12. -moz-transform:$in;
  13. -o-transform:$in;
  14. -ms-transform:$in;
  15. }
  16. $plusminus-height: 2.5px;
  17. $plusminus-anim-length: .25s;
  18. // All hidden elements
  19. .hidden {
  20. visibility: hidden;
  21. opacity: 0;
  22. height: 10px;
  23. padding: 0px !important;
  24. }
  25. // Plusminus buttons
  26. // Adapted from https://codepen.io/FluidOfInsanity/pen/EyQGgw
  27. input[type="checkbox"] {
  28. display: none;
  29. }
  30. .plusminus {
  31. display: block;
  32. position: absolute;
  33. top: 9px;
  34. right: -30px;
  35. padding: .3em;
  36. width: 20px;
  37. height: 20px;
  38. background: #d4d4d4;
  39. border-radius: 25px;
  40. @include transition(0.25s);
  41. }
  42. div.cell:hover .plusminus {
  43. background: rgb(122, 130, 136);
  44. @include transition(0.25s);
  45. }
  46. .plusminus span {
  47. display: block;
  48. position: absolute;
  49. border-radius: 3px;
  50. background: #f2f2f2;
  51. @include transition(all $plusminus-anim-length ease);
  52. margin: 0% 15%;
  53. height: $plusminus-height;
  54. width: 70%;
  55. /*- half the width*/
  56. left: 0px;
  57. bottom:0px;
  58. right:0px;
  59. top: calc(50% - #{$plusminus-height} / 2);
  60. }
  61. input:checked ~ .plusminus span.pm_v {
  62. @include transform(rotate(-90deg));
  63. }