auto-highlight.less 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. @import "ui-variables";
  2. @import "syntax-variables";
  3. @base-color: @syntax-background-color;
  4. // Functions
  5. .color (@scope, @color) {
  6. @{scope}: contrast(@base-color, darken(@color, 10%), lighten(@color, 20%));
  7. }
  8. .round-box () {
  9. box-sizing: border-box;
  10. border-radius: @component-border-radius;
  11. border-width: 2px;
  12. border-style: solid;
  13. }
  14. .box(@name, @color) {
  15. .auto-highlight.@{name} .region {
  16. .round-box;
  17. .color(border-color, @color);
  18. }
  19. }
  20. // Selection highlight
  21. @sbase: @syntax-result-marker-color;
  22. .box(@name) {
  23. .auto-highlight.@{name} .region {
  24. .round-box;
  25. border-width: 0px;
  26. background-color: hsla(hue(@sbase), saturation(@sbase), lightness(@sbase), 0.3);
  27. }
  28. }
  29. .highlight(@name, @color) {
  30. .auto-highlight.@{name} .region {
  31. background-color: fade(@color, 50%);
  32. }
  33. }
  34. .underline(@name, @color) {
  35. .auto-highlight.@{name} .region {
  36. .color(border-color, @color);
  37. box-sizing: border-box;
  38. border-width: 0px;
  39. border-bottom-width: 2px;
  40. border-style: solid;
  41. }
  42. }
  43. @color-base: hsl(0, 100%, 50%);
  44. @color01: spin(@color-base, 138);
  45. @color02: spin(@color-base, 270);
  46. @color03: spin(@color-base, 315);
  47. @color04: spin(@color-base, 366);
  48. @color05: spin(@color-base, 180);
  49. @color06: spin(@color-base, 399);
  50. @color07: spin(@color-base, 0);
  51. atom-text-editor {
  52. .underline(underline-01, @color01);
  53. .underline(underline-02, @color02);
  54. .underline(underline-03, @color03);
  55. .underline(underline-04, @color04);
  56. .underline(underline-05, @color05);
  57. .underline(underline-06, @color06);
  58. .underline(underline-07, @color07);
  59. .box(box-01, @color01);
  60. .box(box-02, @color02);
  61. .box(box-03, @color03);
  62. .box(box-04, @color04);
  63. .box(box-05, @color05);
  64. .box(box-06, @color06);
  65. .box(box-07, @color07);
  66. .highlight(highlight-01, @color01);
  67. .highlight(highlight-02, @color02);
  68. .highlight(highlight-03, @color03);
  69. .highlight(highlight-04, @color04);
  70. .highlight(highlight-05, @color05);
  71. .highlight(highlight-06, @color06);
  72. .highlight(highlight-07, @color07);
  73. .box(box-selection);
  74. }