Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Build material design interfaces in record time... without stress for devs... 🍺💛

License

NotificationsYou must be signed in to change notification settings

beercss/beercss

Repository files navigation

Beer CSS logo

LicenseDownloadsminzipped sizeVersionPull RequestIssues

Beer CSS

Build material design interfaces in record time...

...without stress for devs 🍺💛

Cheers,www.beercss.com

Sponsors

Beer CSS is an MIT-licensed open source project with its ongoing development made possible entirely by the support of these awesome sponsors and backers. If you'd like to join them, please consider sponsoring Beer CSS's development.

Open Collective sponsors

Sponsors

Backers

Github sponsors

SponsorsSponsors

Why?

  • 🥇 The first CSS framework based on Material Design 3.
  • ⬇️ 10x smaller than others CSS frameworks based on Material Design.
  • 🧙‍♂️ Translates Material Design to HTML semantic standard.
  • 🤓 Ready to use with any JS framework.
  • 🪄 Highly focused on DX.
  • 🚫 No build steps, configurations or dependencies.
  • ✨ Build modern interfaces without any custom CSS.

A lightweight beer

Let's be honest, in the ever-evolving world of web development, we're all looking for that sweet spot: powerful functionality without the bloat. We want speed, efficiency, and something that doesn't feel like lugging around a digital elephant. And if you're looking at the chart below, you're probably thinking, "Wow, XYZ is huge!". You're not wrong. But look all the way to the top. See that? That's Beer CSS.

image

The principles

This project was guided by the"Germany Beer Purity Law" or"Reinheitsgebot" created in 1516. This law states that beer should only be brewed with the following ingredients:water,barley malt andhops. Only 3 ingredients. Exciting, right? So we thinking about It and our 3 ingredients are:settings,elements andhelpers. This sounds weird at first time, because It's not BEM, OOCSS, SMACSS, ITCSS, "Utility first" or any other approach. Our approach doesn't avoid some bad practices, but is lightweight, tasty and pure like a beer. Just try it and feel it! 😁

|  SETTINGS     |       // The settings affects all document|---------------|----||               |    ||  ELEMENTS     |    |  // The elements are the components, widgets or tags|               |    ||---------------|    ||               |    ||               |    ||  HELPERS      |----|  // The common helpers makes the elements more scalable and customizable|               ||               ||---------------|

✅ DO:

// 1 setting to 1 document<body>...</body>// 1 element to N helpers<element>...</element><div>...</div>// nav elements before all others<body>  <nav>...</nav>  ...</body><div>  <nav>...</nav>  ...</div>// write css like this.element.helper {...}.element > .element {...}.element > .helper {...}

🚫 DON'T:

// N elements to 1 tag<div>...</div>// element with dependencies<div>  <div>...</div>  <div>...</div>  <div>...</div></div>// nav elements after all others<body>  ...  <nav>...</nav></body><div>  ...  <nav>...</nav></div>// write css like this.element.element {...}.element .element {...}.element .helper {...}

Get started

CDN

From jsdelivr.net.

// with html<linkhref="https://cdn.jsdelivr.net/npm/beercss@3.9.7/dist/cdn/beer.min.css"rel="stylesheet"/><scripttype="module"src="https://cdn.jsdelivr.net/npm/beercss@3.9.7/dist/cdn/beer.min.js"></script><scripttype="module"src="https://cdn.jsdelivr.net/npm/material-dynamic-colors@1.1.2/dist/cdn/material-dynamic-colors.min.js"></script>
// with css@import"https://cdn.jsdelivr.net/npm/beercss@3.9.7/dist/cdn/beer.min.css";
// with javascriptimport"https://cdn.jsdelivr.net/npm/beercss@3.9.7/dist/cdn/beer.min.js";import"https://cdn.jsdelivr.net/npm/material-dynamic-colors@1.1.2/dist/cdn/material-dynamic-colors.min.js";

NPM

You can get the latest release using NPM. This release contains source files as well as the compiled CSS and JavaScript files.

// installingnpmibeercssnpmimaterial-dynamic-colors
// importing as window.beercss and window.materialDynamicColorsimport"beercss";import"material-dynamic-colors";
// importing as beercss and materialDynamicColorsimportbeercssfrom"beercss";importmaterialDynamicColorsfrom"material-dynamic-colors";
// importing manually from distimport"beercss/dist/cdn/beer.min.css";importbeercssfrom"beercss/dist/cdn/beer.min.js";importmaterialDynamicColorsfrom"material-dynamic-colors/dist/cdn/material-dynamic-colors.min.js";
// importing manually from srcimport"beercss/src/cdn/beer.css";importbeercssfrom"beercss/src/cdn/beer.ts";importmaterialDynamicColorsfrom"material-dynamic-colors/src/cdn/material-dynamic-colors.js";

HTML

You can use this html to setup your project. See onCodepen. More about inMain layout.

<html><head><metacharset="UTF-8"><metaname="viewport"content="width=device-width, initial-scale=1"><metahttp-equiv="X-UA-Compatible"content="ie=edge"><metaname="google"content="notranslate"><title>Hello world</title><linkhref="https://cdn.jsdelivr.net/npm/beercss@3.9.7/dist/cdn/beer.min.css"rel="stylesheet"><scripttype="module"src="https://cdn.jsdelivr.net/npm/beercss@3.9.7/dist/cdn/beer.min.js"></script><scripttype="module"src="https://cdn.jsdelivr.net/npm/material-dynamic-colors@1.1.2/dist/cdn/material-dynamic-colors.min.js"></script></head><bodyclass="dark"><navclass="left drawer l"><header><nav><imgsrc="https://www.beercss.com/favicon.png"class="circle"><h6>Cheers</h6></nav></header><a><i>home</i><div>Home</div></a><a><i>search</i><div>Search</div></a><a><i>share</i><div>Share</div></a><a><i>more_vert</i><div>More</div></a><divclass="divider"></div><label>Label</label><a><i>widgets</i><div>Widgets</div></a><a><i>chat</i><div>Chat</div></a><a><i>help</i><div>Help</div></a></nav><navclass="left m"><header><imgsrc="https://www.beercss.com/favicon.png"class="circle"></header><a><i>home</i><div>Home</div></a><a><i>search</i><div>Search</div></a><a><i>share</i><div>Share</div></a><a><i>more_vert</i><div>More</div></a></nav><navclass="bottom s"><a><i>home</i></a><a><i>search</i></a><a><i>share</i></a><a><i>more_vert</i></a></nav><mainclass="responsive"><imgsrc="https://www.beercss.com/beer-and-woman.svg"class="responsive round"><h3>Welcome</h3><h5>The beer is ready!</h5></main></body></html>

We recommend use the material-dynamic-colors only when your app needs to change theme at runtime.

Documentation

Complete documentation and examples available at:

Contributing guide

Hi! We are really excited that you are interested in contributing to Beer CSS! Before submitting your contribution, please make sure to take a moment and read through the following guidelines:

Beer CSS Contributing Guidelines

License

MIT

Cheers to all stargazers 🍻

Stargazers repo roster for @beercss/beercss

Stargazers over time

Stargazers over time


[8]ページ先頭

©2009-2025 Movatter.jp