mixins.scss 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. @function get-color($mode, $key) {
  2. @if map-has-key($themes, $mode) {
  3. $theme: map-get($themes, $mode);
  4. @if map-has-key($theme, $key) {
  5. @return map-get($theme, $key);
  6. }
  7. }
  8. @return red; // default color for debugging purpose
  9. }
  10. @function get-light-color($key) {
  11. @return get-color('light', $key);
  12. }
  13. @function get-dark-color($key) {
  14. @return get-color('dark', $key);
  15. }
  16. @mixin reset-list {
  17. margin: 0;
  18. padding: 0;
  19. list-style: none;
  20. }
  21. @mixin section-title-adjustment() {
  22. h1 > span {
  23. margin-top: -55px; /* Size of fixed header */
  24. padding-bottom: 55px;
  25. display: block;
  26. }
  27. }
  28. @mixin brand-background() {
  29. @each $brand, $color in $brand-colors {
  30. .bg-#{$brand} {
  31. background-color: $color;
  32. }
  33. }
  34. }
  35. @mixin transition() {
  36. transition: all $transition-type $transition-duration;
  37. }
  38. @mixin selection-color($theme: 'light') {
  39. background: get-light-color('accent-color');
  40. color: get-light-color('text-over-accent-color');
  41. @if $theme == 'dark' {
  42. background: get-dark-color('accent-color');
  43. color: get-dark-color('text-over-accent-color');
  44. }
  45. }
  46. @function get-alert-bg-color($type, $mode) {
  47. $colors: map-get($alerts, $type);
  48. @if $mode == 'light' {
  49. @return map-get($colors, 'bg-color');
  50. } @else {
  51. @return map-get($colors, 'text-color');
  52. }
  53. @return red;
  54. }
  55. @function get-alert-text-color($type, $mode) {
  56. $colors: map-get($alerts, $type);
  57. @if $mode == 'light' {
  58. @return map-get($colors, 'text-color');
  59. } @else {
  60. @return map-get($colors, 'bg-color');
  61. }
  62. @return red;
  63. }