styles.tsx 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import styled from "styled-components";
  2. export const StyledTextWrapper = styled.div`
  3. display: flex;
  4. justify-content: center;
  5. align-items: center;
  6. font-size: 12px;
  7. width: 100%;
  8. height: 100%;
  9. overflow: hidden;
  10. cursor: pointer;
  11. `;
  12. export const StyledText = styled.pre<{ width: number; height: number }>`
  13. display: flex;
  14. justify-content: center;
  15. flex-direction: column;
  16. width: ${({ width }) => width};
  17. height: ${({ height }) => height};
  18. min-height: 50;
  19. color: ${({ theme }) => theme.TEXT_NORMAL};
  20. `;
  21. export const StyledForeignObject = styled.foreignObject`
  22. pointer-events: none;
  23. * {
  24. font-family: "Roboto Mono", monospace;
  25. }
  26. &.searched {
  27. border: 2px solid ${({ theme }) => theme.TEXT_POSITIVE};
  28. border-radius: 2px;
  29. }
  30. .highlight {
  31. background-color: rgba(255, 0, 255, 0.5);
  32. filter: hue-rotate();
  33. }
  34. .renderVisible {
  35. display: flex;
  36. justify-content: center;
  37. align-items: center;
  38. font-size: 12px;
  39. width: 100%;
  40. height: 100%;
  41. overflow: hidden;
  42. cursor: pointer;
  43. }
  44. `;
  45. export const StyledKey = styled.span<{
  46. objectKey?: boolean;
  47. parent?: boolean;
  48. }>`
  49. font-weight: 500;
  50. color: ${({ theme, objectKey, parent }) =>
  51. parent ? theme.NODE_KEY : objectKey ? "#5c87ff" : theme.TEXT_POSITIVE};
  52. `;
  53. export const StyledRow = styled.span<{ width: number }>`
  54. height: 18px;
  55. overflow: hidden;
  56. text-overflow: ellipsis;
  57. white-space: nowrap;
  58. padding: 0 auto;
  59. width: ${({ width }) => `${width - 20}px`};
  60. `;