_json_explorer.scss 2.3 KB

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