Skip to content

Commit

Permalink
Margin top and bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Dunn committed Nov 18, 2023
1 parent e4527ab commit e946ce9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# barrel.css
A CSS Framework aiming to be as opinionated as possible for maximum restyling possibilities.

It is a combination of classless styles, a mix of high and low level utilities, and a tiny selection of components.
It is a combination of classless styles, a mix of high and low level utilities, and a tiny selection of components. Unlike utility-first frameworks, we don't have millions of styles for every possible color and size.

You do as much as you can semantically, and fill in the rest with semi-semantic classes. There are classes like .margin-bottom, letting the theme decide how much margin, not specific things like .margin-bottom-3px.


It supports automatic dark/light theme switching with the system preference, desktop, mobile, and also aims to work as well as possible in print media, especially if you use extra hint classes.

Expand Down Expand Up @@ -170,7 +173,10 @@ Add padding just to bottom. Useful for fixing scrollbar showing up
when not needed.

### .margin
The element will have a reasonable theme dependent amount of margin.
The element will have a reasonable theme dependent amount of margin(Determined by --gap).

### .margin-top, .margin-bottom
Add margin to the top or bottom of an element.

### .align-left, .align-center, .align-right
These apply to both text content, and flex items.
Expand Down
8 changes: 8 additions & 0 deletions css/barrel.css
Original file line number Diff line number Diff line change
Expand Up @@ -1729,6 +1729,14 @@ footer.padding {
margin: var(--gap);
}

.margin-top {
margin-bottom: var(--gap);
}

.margin-bottom {
margin-bottom: var(--gap);
}

.nomargin {
margin: 0px;
}
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<main>
<section class="window paper">
<header class="padding"><button>Look! A Header that is a button!</button></header>
<header class="padding margin-bottom"><button>Look! A Header that is a button!</button></header>

<h2>🍂Basic Page🌱</h2>

Expand Down

0 comments on commit e946ce9

Please sign in to comment.