MCPcopy Create free account
hub / github.com/TanStack/query / stylesFactory

Function stylesFactory

packages/query-devtools/src/Explorer.tsx:856–1014  ·  view source on GitHub ↗
(
  theme: 'light' | 'dark',
  css: (typeof goober)['css'],
)

Source from the content-addressed store, hash-verified

854}
855
856const stylesFactory = (
857 theme: 'light' | 'dark',
858 css: (typeof goober)['css'],
859) => {
860 const { colors, font, size, border } = tokens
861 const t = (light: string, dark: string) => (theme === 'light' ? light : dark)
862 return {
863 search: css`
864 display: flex;
865 gap: ${size[2]};
866 margin-bottom: ${size[2]};
867 `,
868 searchInput: css`
869 min-width: 0;
870 flex: 1;
871 padding: ${size[1]} ${size[2]};
872 color: inherit;
873 background: ${t(colors.gray[100], colors.darkGray[600])};
874 border: 1px solid ${t(colors.gray[300], colors.darkGray[400])};
875 border-radius: ${border.radius.xs};
876 `,
877 clearSearch: css`
878 color: inherit;
879 background: transparent;
880 border: none;
881 cursor: pointer;
882 `,
883 highlight: css`
884 && {
885 color: ${t(colors.gray[900], colors.gray[100])};
886 background-color: ${t(colors.yellow[200], colors.yellow[900])};
887 }
888 `,
889 entry: css`
890 & * {
891 font-size: ${font.size.xs};
892 font-family:
893 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
894 'Liberation Mono', 'Courier New', monospace;
895 }
896 position: relative;
897 outline: none;
898 word-break: break-word;
899 `,
900 subEntry: css`
901 margin: 0 0 0 0.5em;
902 padding-left: 0.75em;
903 border-left: 2px solid ${t(colors.gray[300], colors.darkGray[400])};
904 /* outline: 1px solid ${colors.teal[400]}; */
905 `,
906 expander: css`
907 & path {
908 stroke: ${colors.gray[400]};
909 }
910 & svg {
911 width: ${size[3]};
912 height: ${size[3]};
913 }

Callers 2

lightStylesFunction · 0.70
darkStylesFunction · 0.70

Calls 1

tFunction · 0.70

Tested by

no test coverage detected