_json_explorer.scss 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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: $space-md;
  11. }
  12. .json-formatter-children {
  13. &.json-formatter-empty {
  14. opacity: 0.5;
  15. margin-left: $space-md;
  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: pre-wrap;
  30. word-wrap: break-word;
  31. word-break: break-all;
  32. }
  33. .json-formatter-number {
  34. color: $json-explorer-number-color;
  35. }
  36. .json-formatter-boolean {
  37. color: $json-explorer-boolean-color;
  38. }
  39. .json-formatter-null {
  40. color: $json-explorer-null-color;
  41. }
  42. .json-formatter-undefined {
  43. color: $json-explorer-undefined-color;
  44. }
  45. .json-formatter-function {
  46. color: $json-explorer-function-color;
  47. }
  48. .json-formatter-date {
  49. background-color: fade($json-explorer-default-color, 5%);
  50. }
  51. .json-formatter-url {
  52. text-decoration: underline;
  53. color: $json-explorer-url-color;
  54. cursor: pointer;
  55. }
  56. .json-formatter-bracket {
  57. color: $json-explorer-bracket-color;
  58. }
  59. .json-formatter-key {
  60. color: $json-explorer-key-color;
  61. cursor: pointer;
  62. padding-right: $space-xxs;
  63. margin-right: 4px;
  64. }
  65. .json-formatter-constructor-name {
  66. cursor: pointer;
  67. }
  68. .json-formatter-array-comma {
  69. margin-right: 4px;
  70. }
  71. .json-formatter-toggler {
  72. line-height: 16px;
  73. font-size: $font-size-xs;
  74. vertical-align: middle;
  75. opacity: $json-explorer-toggler-opacity;
  76. cursor: pointer;
  77. padding-right: $space-xxs;
  78. &::after {
  79. display: inline-block;
  80. transition: transform $json-explorer-rotate-time ease-in;
  81. content: '►';
  82. }
  83. }
  84. // Inline preview on hover (optional)
  85. > a > .json-formatter-preview-text {
  86. opacity: 0;
  87. transition: opacity 0.15s ease-in;
  88. font-style: italic;
  89. }
  90. &:hover > a > .json-formatter-preview-text {
  91. opacity: 0.6;
  92. }
  93. // Open state
  94. &.json-formatter-open {
  95. > .json-formatter-toggler-link .json-formatter-toggler::after {
  96. transform: rotate(90deg);
  97. }
  98. > .json-formatter-children::after {
  99. display: inline-block;
  100. }
  101. > a > .json-formatter-preview-text {
  102. display: none;
  103. }
  104. &.json-formatter-empty::after {
  105. display: block;
  106. }
  107. }
  108. }