Skip to content

Commit c0847c5

Browse files
committed
Add custom breakpoints
1 parent 127b6fe commit c0847c5

File tree

9 files changed

+2075
-133
lines changed

9 files changed

+2075
-133
lines changed

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
1+
<!-- https://keepachangelog.com/en/1.1.0/ -->
2+
13
# Changelog
24

5+
## [2.0.0] - 2024-04-08
6+
7+
### Added
8+
9+
- Add custom breakpoints for container queries:
10+
```scss
11+
$container-queries-breakpoints: (
12+
sm: 30em,
13+
md: 48em,
14+
lg: 62em,
15+
xl: 75em,
16+
xxl: 90em
17+
) !default;
18+
```
19+
- Add buttons to change the size of the container in the demo page.
20+
321
## [1.4.0] - 2024-03-25
422

523
### Added

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,17 @@ You can make the element float at `start`, `end` or `none` with `.bcq-float-{val
4545
### Margin and padding
4646

4747
You can add the bootstrap margin or padding with `.bcq-m{sides}-{breakpoint}-{value}` or `.bcq-p{sides}-{breakpoint}-{value}`.
48+
49+
## Custom breakpoints
50+
51+
You can add custom breakpoints for container queries:
52+
53+
```scss
54+
$container-queries-breakpoints: (
55+
sm: 30em,
56+
md: 48em,
57+
lg: 62em,
58+
xl: 75em,
59+
xxl: 90em
60+
);
61+
```

docs/index.html

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,25 @@
1313
<link href="./style.css" rel="stylesheet" />
1414
<style>
1515
.resizable {
16-
width: 500px;
16+
width: 30em;
1717
resize: horizontal;
1818
margin: 0 auto;
1919
overflow: hidden;
2020
}
2121
</style>
2222
</head>
2323
<body>
24-
<h1>Bootstrap Container Queries</h1>
24+
<h1 class="display-1 text-center">Bootstrap Container Queries</h1>
25+
<div class="text-center">
26+
<div class="btn-group mb-3" role="group">
27+
<button type="button" class="btn btn-outline-primary" data-size="28">xs</button>
28+
<button type="button" class="btn btn-outline-primary" data-size="30">sm</button>
29+
<button type="button" class="btn btn-outline-primary" data-size="48">md</button>
30+
<button type="button" class="btn btn-outline-primary" data-size="62">lg</button>
31+
<button type="button" class="btn btn-outline-primary" data-size="75">xl</button>
32+
<button type="button" class="btn btn-outline-primary" data-size="90">xxl</button>
33+
</div>
34+
</div>
2535
<div class="resizable border border-primary">
2636
<div class="bcq row">
2737
<div class="bcq-sm-6 bcq-md-4 bcq-lg-3">bcq-sm-6 bcq-md-4 bcq-lg-3</div>
@@ -62,4 +72,11 @@ <h1>Bootstrap Container Queries</h1>
6272
</div>
6373
</div>
6474
</body>
75+
<script>
76+
document.querySelectorAll("button").forEach((button) => {
77+
button.addEventListener("click", () => {
78+
document.querySelector(".resizable").style.width = `${button.dataset.size}em`;
79+
});
80+
});
81+
</script>
6582
</html>

0 commit comments

Comments
 (0)