_json_explorer.scss 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. .json-formatter-row {
  2. font-family: monospace;
  3. &,
  4. a,
  5. a:hover {
  6. color: $json-explorer-default-color;
  7. text-decoration: none;
  8. }
  9. .json-formatter-row {
  10. margin-left: 1rem;
  11. }
  12. .json-formatter-children {
  13. &.json-formatter-empty {
  14. opacity: 0.5;
  15. margin-left: 1rem;
  16. &::after {
  17. display: none;
  18. }
  19. &.json-formatter-object::after {
  20. content: "No properties";
  21. }
  22. &.json-formatter-array::after {
  23. content: "[]";
  24. }
  25. }
  26. }
  27. .json-formatter-string {
  28. color: $json-explorer-string-color;
  29. white-space: normal;
  30. word-wrap: break-word;
  31. }
  32. .json-formatter-number {
  33. color: $json-explorer-number-color;
  34. }
  35. .json-formatter-boolean {
  36. color: $json-explorer-boolean-color;
  37. }
  38. .json-formatter-null {
  39. color: $json-explorer-null-color;
  40. }
  41. .json-formatter-undefined {
  42. color: $json-explorer-undefined-color;
  43. }
  44. .json-formatter-function {
  45. color: $json-explorer-function-color;
  46. }
  47. .json-formatter-date {
  48. background-color: fade($json-explorer-default-color, 5%);
  49. }
  50. .json-formatter-url {
  51. text-decoration: underline;
  52. color: $json-explorer-url-color;
  53. cursor: pointer;
  54. }
  55. .json-formatter-bracket {
  56. color: $json-explorer-bracket-color;
  57. }
  58. .json-formatter-key {
  59. color: $json-explorer-key-color;
  60. cursor: pointer;
  61. padding-right: 0.2rem;
  62. margin-right: 4px;
  63. }
  64. .json-formatter-constructor-name {
  65. cursor: pointer;
  66. }
  67. .json-formatter-array-comma {
  68. margin-right: 4px;
  69. }
  70. .json-formatter-toggler {
  71. line-height: 1.2rem;
  72. font-size: 0.7rem;
  73. vertical-align: middle;
  74. opacity: $json-explorer-toggler-opacity;
  75. cursor: pointer;
  76. padding-right: 0.2rem;
  77. &::after {
  78. display: inline-block;
  79. transition: transform $json-explorer-rotate-time ease-in;
  80. content: "►";
  81. }
  82. }
  83. // Inline preview on hover (optional)
  84. > a > .json-formatter-preview-text {
  85. opacity: 0;
  86. transition: opacity 0.15s ease-in;
  87. font-style: italic;
  88. }
  89. &:hover > a > .json-formatter-preview-text {
  90. opacity: 0.6;
  91. }
  92. // Open state
  93. &.json-formatter-open {
  94. > .json-formatter-toggler-link .json-formatter-toggler::after {
  95. transform: rotate(90deg);
  96. }
  97. > .json-formatter-children::after {
  98. display: inline-block;
  99. }
  100. > a > .json-formatter-preview-text {
  101. display: none;
  102. }
  103. &.json-formatter-empty::after {
  104. display: block;
  105. }
  106. }
  107. }