DEV Community

Makoto Tateno
Makoto Tateno

Posted on • Edited on

1

Introducing Undecorated: Collection of reusable layout pattern of CSS and styled-components

Introducing new project called Undecorated. This is available at https://makotot.github.io/undecorated/.

I made Undecorated mainly for the following two purposes.

  • To be able to browse a variety of reusable CSS layout patterns and make them available for instant copy and paste.

  • Just import it with npm so that you can create the layout you want.

There are multiple sites that list layout patterns in grid and sites that introduce layout patterns in flexbox, but I could not find any sites that could view various layout patterns (regardless of properties such as flexbox, grid, table, etc) .
So I wanted to create a site where I could browse various CSS layout patterns.

In addition, I want to make those layout patterns available anywhere just by import(
For now with styled-components).
For example, if you want to center an element vertically and horizontally, you can do it by just following.

import { Centered } from 'undecorated'

<Centered>
  <SomethingYouWantToCenter />
</Centered>

Unlike the existing flexbox and grid utility libraries that leave the layout to the user, it only provides patterns that achieve a specific CSS layout.

The source code is on Github.

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

AWS GenAI LIVE!

GenAI LIVE! is a dynamic live-streamed show exploring how AWS and our partners are helping organizations unlock real value with generative AI.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️