Skip to content

Commit 319001e

Browse files
refactor: styles refactoring
1 parent 3be5e95 commit 319001e

File tree

3 files changed

+161
-22
lines changed

3 files changed

+161
-22
lines changed

example/index.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
@import "@edx/brand/paragon/fonts";
1+
@import url("https://cdn.jsdelivr.net/npm/@edx/brand-edx.org@alpha/dist/core.min.css");
2+
@import url("https://cdn.jsdelivr.net/npm/@edx/brand-edx.org@alpha/dist/light.min.css");
23
@import "@edx/paragon/styles/scss/core/core";
34
@import "@edx/paragon/styles/css/themes/light/index.css";
4-
@import "@edx/brand/paragon/overrides";
55

66
@import "@edx/frontend-component-header/index";

src/Menu/menu.scss

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,45 @@
11
.menu {
22
position: relative;
33
}
4+
45
.menu-content {
56
position: absolute;
67
top: 100%;
78
z-index: 10;
8-
background: #fff;
9+
background: var(--pgn-color-white);
910
min-width: 10rem;
11+
1012
&.pin-left {
1113
left: 0;
1214
}
15+
1316
&.pin-right {
1417
right: 0;
1518
}
1619
}
1720

18-
1921
.menu-dropdown-enter {
2022
opacity: 0;
2123
transform-origin: 75% 0;
2224
transform: scale3d(0.8, 0.8, 1);
2325
}
26+
2427
.menu-dropdown-enter-active {
2528
transform-origin: 75% 0;
2629
transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
2730
transform: scale3d(1, 1, 1);
2831
opacity: 1;
2932
}
30-
.menu-dropdown-enter-done {
31-
}
3233

3334
.menu-dropdown-exit {
3435
transform-origin: 75% 0;
3536
transform: scale3d(1, 1, 1);
3637
opacity: 1;
3738
}
39+
3840
.menu-dropdown-exit-active {
3941
transform-origin: 75% 0;
4042
transform: scale3d(0.8, 0.8, 1);
4143
transition: all 250ms cubic-bezier(0.8, 0, 0.6, 1);
4244
opacity: 0;
4345
}
44-
.menu-dropdown-exit-done {
45-
}

src/index.scss

+153-14
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ $white: #fff;
2020
padding: .75rem;
2121
justify-content: center;
2222
align-items:center;
23+
2324
&:hover, &:focus {
24-
background: rgba(0,0,0,.1);
25+
background: rgba(0, 0, 0, .1);
2526
}
2627
}
2728

@@ -35,16 +36,15 @@ $white: #fff;
3536
white-space: nowrap;
3637
overflow: hidden;
3738
text-overflow: ellipsis;
38-
padding-bottom: 0.1rem;
39+
padding-bottom: var(--pgn-spacing-spacer-base);
3940
}
4041
}
4142

42-
.user-dropdown {
43-
.btn {
44-
height: 3rem;
45-
@media (max-width: -1 + map-get($grid-breakpoints, "sm")) {
46-
padding: 0 0.5rem;
47-
}
43+
.user-dropdown .btn {
44+
height: 3rem;
45+
46+
@media (--max-pgn-size-breakpoint-xs) {
47+
padding: 0 .5rem;
4848
}
4949
}
5050
}
@@ -62,59 +62,198 @@ $white: #fff;
6262
text-decoration: none;
6363
cursor: pointer;
6464
}
65+
6566
img {
6667
height: 1.5rem;
6768
}
6869
}
6970

7071

7172
.site-header-desktop {
72-
box-shadow: 0 1px 0 0 rgba(0,0,0,.1);
73+
box-shadow: 0 1px 0 0 rgba(0, 0, 0, .1);
7374
background: var(--pgn-color-white);
75+
7476
.nav-link {
7577
text-decoration: none;
7678
}
79+
7780
.logo {
7881
display: block;
7982
box-sizing: content-box;
8083
position: relative;
8184
top: -.05em;
8285
height: 1.75rem;
83-
padding: 1rem 0;
84-
margin-right: 1rem;
86+
padding: var(--pgn-spacing-spacer-base) 0;
87+
margin-right: var(--pgn-spacing-spacer-base);
88+
8589
img {
8690
display: block;
8791
height: 100%;
8892
}
8993
}
94+
9095
.main-nav {
9196
.nav-link {
92-
padding: 1.125rem 1rem;
97+
padding: 1.125rem var(--pgn-spacing-spacer-base);
9398
text-decoration: none;
9499
font-weight: 500;
95100
letter-spacing: .01em;
96101
}
102+
97103
.nav-link:hover,
98104
.nav-link:focus,
99105
.nav-link.active,
100106
.expanded .nav-link {
101107
background: var(--pgn-color-bg-active);
102108
color: var(--pgn-color-active);
103109
}
110+
104111
.menu {
105112
position: static;
113+
106114
.menu-content {
107115
border-top: solid 2px var(--pgn-color-bg-active);
108116
left: 0;
109117
right: 0;
110-
box-shadow: 0 1px 2px rgba(0,0,0,.25);
118+
box-shadow: var(--pgn-elevation-box-shadow-down-1);
111119
border-bottom-left-radius: 2px;
112120
border-bottom-right-radius: 2px;
113-
padding: 1rem;
121+
padding: var(--pgn-spacing-spacer-base);
114122
}
115123
}
116124
}
125+
117126
.search-input {
118127
border-radius: var(--pgn-size-rounded-pill);
119128
}
120129
}
130+
131+
.content b {
132+
color: var(--pgn-color-primary-500) !important;
133+
font-weight: 500 !important;
134+
}
135+
136+
.font-size-18 {
137+
font-size: 18px !important;
138+
}
139+
140+
.font-size-12 {
141+
font-size: 12px;
142+
}
143+
144+
.font-size-14 {
145+
font-size: 14px;
146+
}
147+
148+
.py-10px {
149+
padding-top: 10px;
150+
padding-bottom: 10px;
151+
}
152+
153+
.pb-10px {
154+
padding-bottom: 10px;
155+
}
156+
157+
.line-height-24 {
158+
line-height: 24px;
159+
}
160+
161+
.line-height-20 {
162+
line-height: 20px;
163+
}
164+
165+
.line-height-10 {
166+
line-height: 10px !important;
167+
}
168+
169+
.icon-size-20 {
170+
width: 20px !important;
171+
height: 20px !important;
172+
}
173+
174+
.cursor-pointer {
175+
cursor: pointer;
176+
}
177+
178+
.notification-button {
179+
width: 36px;
180+
height: 36px;
181+
}
182+
183+
.notification-icon{
184+
height: 23.33px !important;
185+
width: 23.33px !important;
186+
}
187+
188+
.notification-badge {
189+
position: absolute;
190+
margin-top: 18px;
191+
margin-left: -21px;
192+
border: 2px solid var(--pgn-color-white);
193+
font-size: 9px !important;
194+
}
195+
196+
.popover {
197+
max-height: calc(100% - 68px);
198+
min-height: 1220px;
199+
filter: none;
200+
box-shadow: var(--pgn-elevation-box-shadow-down-2);
201+
202+
&.medium-screen {
203+
min-width: 24.313rem;
204+
}
205+
206+
&.large-screen {
207+
min-width: 34.313rem;
208+
}
209+
210+
.dropdown-toggle::after {
211+
display: none;
212+
}
213+
214+
.expandable {
215+
position: relative !important;
216+
margin-left: 4px;
217+
padding: 2px 5px;
218+
border-radius: 10rem;
219+
font-size: 9px;
220+
}
221+
222+
.dropdown-toggle {
223+
font-size: 14px;
224+
padding-top: 0 !important;
225+
padding-bottom: 12px !important;
226+
227+
div {
228+
min-height: 6px !important;
229+
min-width: 6px !important;
230+
}
231+
}
232+
233+
.dropdown-item {
234+
font-size: 14px;
235+
font-weight: 500;
236+
}
237+
238+
.notification-content {
239+
.notification-item-content {
240+
display: -webkit-box;
241+
-webkit-line-clamp: 2;
242+
-webkit-box-orient: vertical;
243+
text-overflow: ellipsis;
244+
245+
p {
246+
margin-bottom: 0;
247+
}
248+
249+
b {
250+
color: var(--pgn-color-primary-500);
251+
}
252+
}
253+
254+
.unread {
255+
height: 10px;
256+
width: 10px;
257+
}
258+
}
259+
}

0 commit comments

Comments
 (0)