Examples of code I've written in PHP, Javascript, SCSS, etc.
 
 
 
 
 
 

58 行
1.1 KiB

  1. @use "sass:map";
  2. @use "sass:color";
  3. $theme-colors: (
  4. "primary": #e2e2e7,
  5. "fade-grey": #828287,
  6. "light-grey": #f0f0f0,
  7. 'link-grey': #525257,
  8. 'h2': black,
  9. 'p': #424242,
  10. "col3": #eee,
  11. "col1": #ffffff,
  12. "col4": #434547,
  13. "col5": #2a2c2d,
  14. "nav": #feca1d,
  15. "nav-light": #ffda01,
  16. "nav2": #daa520,
  17. 'blk': #000,
  18. 'navy-blue': #3e4b75,
  19. 'pale-yellow': #f8ebc2,
  20. 'lightGrey': #fafafc,
  21. 'formGrey': #3b3f44,
  22. 'special_blue': #6573ff,
  23. 'indigo': #6610f2
  24. );
  25. @function getColor($col) {
  26. @return map.get($theme-colors, $col);
  27. }
  28. @function darkenColor($col) {
  29. $oldCol : map.get($theme-colors, $col);
  30. $newCol : color.scale($oldCol, $lightness: -45%);
  31. @return $newCol;
  32. }
  33. @function lightenColor($col) {
  34. $oldCol : map.get($theme-colors, $col);
  35. $newCol : color.scale($oldCol, $lightness: 15%);
  36. @return $newCol;
  37. }
  38. @mixin button($col) {
  39. display: inline-block;
  40. //font-family: $btn-font-family;
  41. font-weight: 400;
  42. background-color: getColor($col);
  43. text-align: center;
  44. vertical-align: middle;
  45. user-select: none;
  46. border: none;
  47. padding: 7px 15px;
  48. border-radius: 5px;
  49. &:hover{
  50. background-color: darkenColor($col);
  51. }
  52. }