Skip to content

Commit

Permalink
Fixed breakpoint bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
BelleNottelling committed Jan 30, 2024
1 parent 9884c09 commit 479cf06
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 34 deletions.
24 changes: 11 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ All the code you need is simple and familiar. A parent container class contains

```HTML
<div class="container">
<div class="row">
<div class="col-3">
<!-- This content will take up 3/12 (or 1/4) of the container -->
</div>
<div class="col-3">
<!-- This content will take up 3/12 (or 1/4) of the container -->
</div>
<div class="col-6">
<!-- This content will take up 6/12 (or 1/2) of the container -->
</div>
</div>
<div class="row">
<div class="col-3">
<!-- This content will take up 3/12 (or 1/4) of the container -->
</div>
<div class="col-3">
<!-- This content will take up 3/12 (or 1/4) of the container -->
</div>
<div class="col-6">
<!-- This content will take up 6/12 (or 1/2) of the container -->
</div>
</div>
</div>
```

Expand All @@ -38,14 +38,12 @@ Not specifying a breakpoint is equal to using the medium breakpoint (EX: `.col-6
- `center`: Centers content.
- `justify`: Applies the "justify" content alignment.
- `hidden-sm`
- `hidden-md`

### Breakpoints

- `sm`: 33.75em; // 540px
- `md`: 45em; // 720px
- `lg`: 60em; // 960px
n

### Typography

Expand Down
17 changes: 10 additions & 7 deletions src/_grid.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@use "sass:math";

/* Grid */
.container {
width: 90%;
margin-left: auto;
Expand Down Expand Up @@ -32,20 +33,22 @@
clear: both;
}

@for $i from 1 through $columns {
.col-#{$i} {
width: $width;
}
}

@media only screen and (min-width: $breakpoint-med) {
@for $i from 1 through $columns {

.col-#{$i},
.col-#{$i}-md {
width: calc($width / $columns * $i - $gutter);
}
}
}

@media only screen and (min-width: $breakpoint-large) {
@for $i from 1 through $columns {
.col-#{$i}-lg {
width: calc($width / $columns * $i - $gutter);
.hidden-sm {
display: block;
}
}
}
}
2 changes: 2 additions & 0 deletions src/_typography.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* Typography */

@import url(https://fonts.googleapis.com/css?family=Lato:400,300,300italic,400italic,700,700italic);

* {
Expand Down
13 changes: 3 additions & 10 deletions src/_utility.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* Utility */
.left {
text-align: left;
}
Expand All @@ -16,14 +17,6 @@
text-align: justify;
}

@media only screen and (min-width: $breakpoint-med) {
.hidden-sm {
display: none;
}
}

@media only screen and (min-width: $breakpoint-large) {
.hidden-md {
display: none;
}
.hidden-sm {
display: none;
}
8 changes: 4 additions & 4 deletions src/default.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
@import "_variables.scss";
@import "_utility.scss";
@import "_grid.scss";

html,
body {
height: 100%;
Expand All @@ -12,3 +8,7 @@ body {
top: 0;
font-size: 100%;
}

@import "_variables.scss";
@import "_utility.scss";
@import "_grid.scss";

0 comments on commit 479cf06

Please sign in to comment.