Skip to content

Instantly share code, notes, and snippets.

@martinhj
Last active June 14, 2022 07:17
Show Gist options
  • Save martinhj/9f5b39be1a5d341c1245cab24ffcd2d7 to your computer and use it in GitHub Desktop.
Save martinhj/9f5b39be1a5d341c1245cab24ffcd2d7 to your computer and use it in GitHub Desktop.
Cosmo related documentation

🐾 Cosmo tooling documentation

Sanity / Next.js / Vercel resources (our stack)

Nextjs:

Nextjs is a framework for building web sites in JS React getting data from any API.

Sanity

Sanity & Nextjs integration:

Vercel - our SaaS hosting provider

Styled components resources (our component library)

Styled components is our css-in-js tool of choice. With it we can with a few lines of code create a css styled component and write it's css styles in js tagged literals like

const OurGreatComponent = styled.div`
  background: yellow;
  text: purple;
  box-shadow: 0 0 0 3px red;
`;

and use it in our React template like

function MyComponent() {
  return (
    <OurGreatComponent>
      <h1>This is great!</h1>
      <p>This is the text about our super awesome component...</p>
    </OurGreatComponent>
  );
}

We are also using styled-components Theme system to be able to do central changes to the component layout to better match a projects branding:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment