Skip to content

Commit 33fbbb3

Browse files
authored
set breakpoints on container not media query (#776)
Related to #708 and fixes input/output panel breakpoints when web component is positioned on a page that doesn't take the full width of the screen Currently the breakpoints change as a result of the positioning of the web component on the page e.g. if additional margin is added around the web component the breakpoints will be effected https://github.com/RaspberryPiFoundation/editor-ui/assets/74183390/371ce394-6fb8-4e97-bb67-2e32e58ef4b9
1 parent 214054c commit 33fbbb3

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
3232

3333
### Fixed
3434

35+
- Container rather than media query breakpoints for the web component (#776)
3536
- `FileMenu` alignment (#720)
3637
- Edit icon not showing in ContextMenu (#720)
3738
- Updated sidebar and file icons to correct size (#720)

src/assets/stylesheets/Project.scss

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
}
3434

3535
.proj-container {
36+
container-type: inline-size;
3637
display: flex;
3738
flex-direction: row;
3839
overflow-y: hidden;
@@ -64,8 +65,7 @@
6465
}
6566

6667
// TODO: use container queries (fix with cquery breaking positioning of drag/drop & autocomplete)
67-
@media (min-width: 912px) {
68-
// width is 880px for the container + the rest of the page
68+
@container (min-width: 880px) {
6969
.proj-editor-wrapper {
7070
flex-flow: row;
7171
}
@@ -143,7 +143,7 @@
143143
background-color: $rpf-white;
144144
}
145145

146-
@media (min-width: 600px) {
146+
@container (min-width: 600px) {
147147
.proj-runner-container,
148148
.proj-editor-container,
149149
.sidebar {
@@ -159,7 +159,7 @@
159159
background-color: $rpf-grey-800;
160160
}
161161

162-
@media (min-width: 600px) {
162+
@container (min-width: 600px) {
163163
.proj-runner-container,
164164
.proj-editor-container,
165165
.sidebar {

0 commit comments

Comments
 (0)