How to use the reakit-system-palette/utils.usePalette function in reakit-system-palette

To help you get started, we’ve selected a few reakit-system-palette examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github reakit / reakit / packages / reakit-playground / src / system.ts View on Github external
export function usePlaygroundEditorProps(
  options: PlaygroundEditorOptions,
  htmlProps: PlaygroundEditorHTMLProps
): PlaygroundEditorHTMLProps {
  const primary = usePalette("primary") || "blue";
  const contrast = useContrast(primary);
  const maxHeight = options.maxHeight ? options.maxHeight : "auto";
  const playgroundEditor = css`
    margin: 2em 0;
    font-family: Consolas, Liberation Mono, Menlo, Courier, monospace;
    font-size: 0.9375em;
    pre& {
      background-color: #282a36 !important;
      color: #f8f8f2 !important;
      border-radius: 0.25em;
      padding: 1em 1.5em;
      max-height: ${maxHeight};
      overflow: auto;
      box-sizing: border-box;
    }
    .CodeMirror {
github reakit / reakit / packages / website / src / components / CoreLayout.tsx View on Github external
export default function CoreLayout(props: CoreLayoutProps) {
  const scrolled = useScrolled();
  const title =
    props.data && props.data.markdownRemark && props.data.markdownRemark.title;
  const isHome = props.location.pathname === "/";
  const background = usePalette("background");
  const foreground = usePalette("foreground");
  const codeBackground = useFade(foreground, 0.95);
  return (
    <>
github reakit / reakit / packages / reakit-playground / src / system.ts View on Github external
export function usePlaygroundPreviewProps(
  _: PlaygroundPreviewOptions,
  htmlProps: PlaygroundPreviewHTMLProps
): PlaygroundPreviewHTMLProps {
  const foreground = usePalette("foreground") || "black";
  const borderColor = useFade(foreground, 0.85);
  const playgroundPreview = css`
    margin: 2em 0 -1.5em 0;
    padding: 1em;
    border: 1px solid ${borderColor};
    border-radius: 0.25em;
  `;
  return {
    ...htmlProps,
    className: cx(playgroundPreview, htmlProps.className)
  };
}
github reakit / reakit / packages / website / src / components / DocsNavigation.tsx View on Github external
function useDocsNavigationCSS() {
  const background = usePalette("background");
  const foreground = usePalette("foreground");
  const primary = usePalette("primary");
  const currentBackgroundColor = useLighten(primary, 0.85);
  const headingColor = useLighten(foreground, 0.5);

  const docsNavigation = css`
    background-color: ${background};
    color: ${foreground};
    h3 {
      font-size: 0.85em;
      text-transform: uppercase;
      padding: 0 1em;
      color: ${headingColor};
      font-weight: 400;
    }
    nav {
      margin: 1.5em 0 0 0;
github reakit / reakit / packages / website / src / components / Blockquote.tsx View on Github external
useProps(options, htmlProps) {
      const isExperimental = options.experimental === "true";
      const warning = usePalette("warning");
      const backgroundColor = useLighten(warning, 0.85);
      const borderColor = useLighten(warning, 0.3);
      const color = useContrast(backgroundColor);
      const blockquote = css`
        color: ${color};
        background-color: ${backgroundColor};
        border-left-color: ${borderColor};
        border-left-width: 8px;
        border-left-style: solid;
        padding: 20px 16px 20px 25px;
        margin: 20px 0;
        line-height: 1.5;

        p {
          margin: 0;
        }
github reakit / reakit / packages / website / src / pages / index.tsx View on Github external
export default function IndexPage() {
  const stars = useGitHubStars();
  const link = usePalette("link");
  return (
    <>
github reakit / reakit / packages / website / src / components / Header.tsx View on Github external
export default function Header({ transparent }: HeaderProps) {
  const ref = React.useRef(null);
  const isLarge = useViewportWidthGreaterThan(768);
  const background = usePalette("background");
  const foreground = usePalette("foreground");
  const primary = usePalette("primary");
  const boxShadowColor = useFade(foreground, 0.85);
  const dialog = useDialogState({ unstable_animated: true });
  const location = useLocation();

  React.useEffect(dialog.hide, [location.pathname]);

  return (
    <>
github reakit / reakit / packages / website / src / components / KeyboardInput.ts View on Github external
useProps(_, htmlProps) {
    const background = usePalette("background");
    const backgroundColor = useDarken(background, 0.08);
    const borderColor = useDarken(backgroundColor, 0.15);
    const keyboardInput = css`
      border-radius: 0.25em;
      font-family: Consolas, Liberation Mono, Menlo, Courier, monospace;
      background-color: ${backgroundColor};
      padding: 0.3em 0.5em 0.25em;
      border: 1px solid ${borderColor};
      border-width: 1px 1px 2px 1px;
      font-size: 0.875em;
    `;
    return {
      ...htmlProps,
      className: cx(keyboardInput, htmlProps.className)
    };
  }
github reakit / reakit / packages / website / src / components / DocsInnerNavigation.tsx View on Github external
function useDocsInnerNavigationCSS() {
  const background = usePalette("background");
  const foreground = usePalette("foreground");
  const borderColor = useLighten(foreground, 0.9);

  const docsInnerNavigation = css`
    font-size: 0.875em;
    background-color: ${background};
    color: ${foreground};

    > * {
      margin-bottom: 16px;
    }

    ul {
      list-style: none;
      margin: 0;
      padding: 0;
github reakit / reakit / packages / website / src / components / DocsInnerNavigation.tsx View on Github external
function useDocsInnerNavigationCSS() {
  const background = usePalette("background");
  const foreground = usePalette("foreground");
  const borderColor = useLighten(foreground, 0.9);

  const docsInnerNavigation = css`
    font-size: 0.875em;
    background-color: ${background};
    color: ${foreground};

    > * {
      margin-bottom: 16px;
    }

    ul {
      list-style: none;
      margin: 0;
      padding: 0;