Skip to content

Commit 2dd2857

Browse files
devvaannshabose
authored andcommitted
refactor: responsive styling
1 parent 6358b61 commit 2dd2857

File tree

2 files changed

+74
-37
lines changed

2 files changed

+74
-37
lines changed

src/extensionsIntegrated/CustomSnippets/htmlContent/snippets-panel.html

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<div id="custom-snippets-panel" class="custom-snippets-panel bottom-panel vert-resizable top-resizer no-focus">
2-
<!--the toolbar at the top-->
3-
<div id="custom-snippets-toolbar" class="custom-snippets-toolbar">
4-
<div class="toolbar-left-section">
5-
<div class="toolbar-title">Custom Snippets <span id="snippets-count" class="snippets-count"></span></div>
2+
<div id="custom-snippets-toolbar" class="toolbar simple-toolbar-layout">
3+
<div class="title-wrapper">
4+
<span class="title toolbar-title">Custom Snippets <span id="snippets-count" class="snippets-count"></span></span>
65
<div id="add-new-snippet-btn" class="custom-snippet-btn">
76
<button title="Add new snippet">
87
<i class="fas fa-plus"></i>
@@ -14,13 +13,13 @@
1413
</button>
1514
</div>
1615
</div>
17-
18-
<div id="filter-snippets-panel" class="filter-snippets-panel">
19-
<input id="filter-snippets-input" type="text" placeholder="Filter..." autocomplete="off" />
20-
</div>
21-
22-
<div id="close-custom-snippets-panel-btn">
23-
<button><i class="fas fa-times"></i></button>
16+
<div class="buttons">
17+
<div id="filter-snippets-panel" class="filter-snippets-panel">
18+
<input id="filter-snippets-input" type="text" placeholder="Filter..." autocomplete="off" />
19+
</div>
20+
<div id="close-custom-snippets-panel-btn">
21+
<button><i class="fas fa-times"></i></button>
22+
</div>
2423
</div>
2524
</div>
2625

src/styles/Extn-CustomSnippets.less

Lines changed: 64 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99

1010
#custom-snippets-toolbar {
1111
background-color: @bc-panel-bg-promoted;
12-
padding: 5px 8px;
13-
display: flex;
14-
align-items: center;
15-
position: relative;
1612
border-bottom: none;
1713
box-shadow:
1814
inset 0 1px 0 @bc-highlight,
@@ -25,13 +21,19 @@
2521
inset 0 1px 0 @dark-bc-highlight,
2622
0 -1px 3px @dark-bc-shadow-small;
2723
}
28-
}
2924

30-
.toolbar-left-section {
31-
display: flex;
32-
align-items: center;
33-
gap: 10px;
34-
flex: 1;
25+
.title-wrapper {
26+
display: flex;
27+
align-items: center;
28+
gap: 10px;
29+
flex-wrap: wrap;
30+
}
31+
32+
.buttons {
33+
gap: 4px;
34+
flex-wrap: wrap;
35+
align-items: center;
36+
}
3537
}
3638

3739
.toolbar-title {
@@ -72,9 +74,6 @@
7274

7375
.filter-snippets-panel {
7476
display: inline-block;
75-
position: absolute;
76-
top: 6px;
77-
right: 40px;
7877
}
7978

8079
.filter-snippets-panel.hidden {
@@ -83,33 +82,27 @@
8382

8483
.filter-snippets-panel #filter-snippets-input {
8584
height: 14px;
86-
width: 220px;
87-
}
88-
89-
90-
#close-custom-snippets-panel-btn {
91-
position: absolute;
92-
top: 9px;
93-
right: 7px;
85+
width: 180px;
86+
min-width: 120px;
87+
margin-bottom: 0;
88+
margin-top: -4px;
9489
}
9590

9691
#close-custom-snippets-panel-btn button {
97-
// remove all the default styling
9892
background: transparent;
9993
border: none;
10094
outline: none;
101-
10295
font-size: 13px;
10396
opacity: 0.7;
10497
color: @bc-text;
10598

10699
.dark & {
107100
color: @dark-bc-text;
108101
}
109-
}
110102

111-
#close-custom-panel-btn button:hover {
112-
opacity: 0.9;
103+
&:hover {
104+
opacity: 0.9;
105+
}
113106
}
114107

115108
#custom-snippets-list.hidden {
@@ -778,3 +771,48 @@
778771
}
779772
}
780773
}
774+
775+
@media (max-width: 600px) {
776+
#custom-snippets-toolbar {
777+
.title-wrapper {
778+
flex-direction: column;
779+
align-items: flex-start;
780+
gap: 4px;
781+
782+
.custom-snippet-btn {
783+
align-self: stretch;
784+
785+
button {
786+
width: 100%;
787+
}
788+
}
789+
}
790+
791+
.buttons {
792+
flex-direction: column;
793+
align-items: stretch;
794+
gap: 2px;
795+
width: 100%;
796+
797+
.filter-snippets-panel,
798+
#close-custom-snippets-panel-btn {
799+
width: 100%;
800+
display: flex;
801+
justify-content: center;
802+
}
803+
804+
.filter-snippets-panel #filter-snippets-input {
805+
width: 100%;
806+
min-width: auto;
807+
}
808+
}
809+
}
810+
}
811+
812+
@media (max-width: 400px) {
813+
#custom-snippets-toolbar {
814+
.title-wrapper {
815+
margin-bottom: 4px;
816+
}
817+
}
818+
}

0 commit comments

Comments
 (0)