Skip to content

Commit e292289

Browse files
authored
Merge pull request #1482 from patternfly/US287490-reduce-padding-on-the-pfe-jump-link
fix: reduce padding on the pfe jump link
2 parents 5304f20 + 394ebf3 commit e292289

39 files changed

+50
-31
lines changed

CHANGELOG-1.x.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# 1.3.4 (TBD)
2-
- [](https://github.com/patternfly/patternfly-elements/commit/) fix: pfe-tabs padding
2+
3+
- [5304f20](https://github.com/patternfly/patternfly-elements/commit/5304f20638db60a7c48028a39b49dfbc42f7acc7) fix: pfe-tabs padding
4+
- [](https://github.com/patternfly/patternfly-elements/commit/) fix: reduce padding on the pfe jump link
35

46
# 1.3.3 (2021-03-18)
57

elements/pfe-accordion/src/pfe-accordion-panel.scss

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,16 @@
1919
.container {
2020
@include pfe-clearfix;
2121
@include pfe-panel-container;
22-
--pfe-accordion__panel-container--Padding: 0 calc(#{pfe-local(Padding, $region: base)} * 3) #{pfe-local(Padding, $region: base)} calc(#{pfe-local(Padding, $region: base)} * 1.5);
23-
22+
padding: pfe-local(Padding, $region: panel-container, $fallback: 0 pfe-local(Padding, $region: panel, $fallback: calc(#{pfe-local(Padding, $region: base)} * 3)) pfe-local(Padding, $region: base) pfe-local(Padding, $region: panel, $fallback: calc(#{pfe-local(Padding, $region: base)} * 1.5)));
2423
:host([disclosure="true"]) & {
25-
--pfe-accordion__panel-container--Padding: 0 calc(#{pfe-local(Padding, $region: base)} * 1.5);
24+
padding: pfe-local(Padding, $region: panel-container, $fallback: pfe-local(Padding, $region: panel, $fallback: calc(#{pfe-local(Padding, $region: base)} * 1.5)));
25+
}
26+
pfe-jump-links-nav & {
27+
padding: pfe-local(Padding, $region: panel-container, $fallback: 0);
28+
--pfe-accordion__panel-container--Padding: 0;
29+
@media (max-width: pfe-breakpoint(md, $max: true)) {
30+
padding: pfe-local(Padding, $region: panel-container, $fallback: 0);
31+
}
2632
}
2733
}
2834

elements/pfe-jump-links/demo/index.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ <h1><code>pfe-jump-links</code></h1>
5858
<div class="content">
5959

6060
<h2 style="text-align: center; margin: 60px auto;" id="standard">PFE Jump Links - standard</h2>
61-
<div style="margin: 0 auto 400px;max-width:1140px;" class="pfe-l-grid pfe-m-gutters">
61+
<div style="margin: 0 auto 60px;max-width:1140px;" class="pfe-l-grid pfe-m-gutters">
6262
<div class="sticky pfe-l-grid__item pfe-m-12-col pfe-m-3-col-on-lg">
6363
<pfe-jump-links-nav id="jumplinks1" sr-text="Page navigation">
64-
<h4 slot="pfe-jump-links-nav--heading">Jump to section</h4>
64+
<h4 slot="pfe-jump-links-nav--heading">Jump to section</h4>
6565
<ul>
6666
<li> <a href="#section1">Section 1</a> </li>
6767
<li> <a href="#section2">Section 2</a> </li>
@@ -200,7 +200,7 @@ <h1 class="pfe-jump-links-panel__section" id="section5">Section 5</h1>
200200
</div>
201201

202202
<h2 style="text-align: center; margin: 60px auto;" id="subsections">PFE Jump Links - with sub sections</h2>
203-
<div style="padding: 20px 20px 400px;background-color: #131313;color: white;" class="pfe-l-grid pfe-m-gutters">
203+
<div style="padding: 20px 20px 40px;background-color: #131313;color: white;" class="pfe-l-grid pfe-m-gutters">
204204
<div class="sticky pfe-l-grid__item pfe-m-12-col pfe-m-3-col-on-lg">
205205
<pfe-jump-links-nav style="margin-right: 30px;" id="jumplinks2" color="darkest" sr-text="Page navigation">
206206
<h4 slot="pfe-jump-links-nav--heading">Jump to section</h4>
@@ -442,7 +442,7 @@ <h1 class="pfe-jump-links-panel__section" id="section50">Section 5</h1>
442442
</div>
443443

444444
<h2 style="text-align: center; margin: 60px auto;" id="autobuild">PFE Jump Links - autobuild (w/ sub sections)</h2>
445-
<div style="margin-bottom: 400px;" class="pfe-l-grid pfe-m-gutters">
445+
<div style="margin-bottom: 60px;" class="pfe-l-grid pfe-m-gutters">
446446
<div class="sticky pfe-l-grid__item pfe-m-12-col pfe-m-3-col-on-lg">
447447
<pfe-jump-links-nav autobuild id="jumplinks8" sr-text="Page navigation">
448448
<h4 slot="pfe-jump-links-nav--heading" id="pfe-jump-links-nav--heading">Jump to section</h4>
@@ -1039,12 +1039,13 @@ <h1 class="pfe-jump-links-panel__section" id="section5">Section 5</h1>
10391039
<pfe-band aside-height="full" aside-desktop="left" id="themable">
10401040
<h2 slot="pfe-band--header" style="text-align: center;">PFE Jump Links - with theming</h2>
10411041

1042-
<pfe-jump-links-nav id="jumplinks1000" style="
1042+
<pfe-jump-links-nav id="jumplinks1000" style="
10431043
10441044
--pfe-jump-links--BackgroundColor: #fff;
10451045
--pfe-jump-links--BorderColor: #e00;
10461046
--pfe-jump-links--FontSize: 16px;
10471047
--pfe-jump-links__heading--FontSize: 12px;
1048+
--pfe-jump-links__nav--Padding: 30px;
10481049
10491050
" slot="pfe-band--aside">
10501051
<h4 slot="pfe-jump-links-nav--heading">Jump to section</h4>

elements/pfe-jump-links/demo/test_page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ <h1><code>pfe-jump-links</code></h1>
5151
<div class="content">
5252

5353
<h2 style="text-align: center; margin: 60px auto;" id="autobuild">PFE Jump Links - autobuild (w/ sub sections)</h2>
54-
<div style="margin-bottom: 400px;" class="pfe-l-grid pfe-m-gutters">
54+
<div style="margin-bottom: 60px;" class="pfe-l-grid pfe-m-gutters">
5555
<div class="sticky pfe-l-grid__item pfe-m-12-col pfe-m-3-col-on-lg">
5656
<pfe-jump-links-nav autobuild id="jumplinks" sr-text="Page navigation" offset="60">
5757
<h4 slot="pfe-jump-links-nav--heading" id="pfe-jump-links-nav--heading">Jump to section</h4>

elements/pfe-jump-links/src/pfe-jump-links-nav.scss

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ $LOCAL-VARIABLES: (
99
BackgroundColor: pfe-var(surface--lightest),
1010
BorderColor: pfe-var(ui-accent),
1111
FontSize: pfe-var(FontSize--md),
12+
Padding: 0,
1213
heading: (
1314
FontSize: pfe-var(FontSize--sm)
1415
),
@@ -26,7 +27,7 @@ $LOCAL-VARIABLES: (
2627

2728
// @TODO We can't strip a unit from a CSS variable
2829
// --pfe-jump-links-panel--offset: pfe-strip-unit(#{var(--pfe-jump-links-panel__section--spacer)});
29-
30+
3031
--context: var(--pfe-jump-links--context);
3132

3233
box-sizing: border-box;
@@ -37,11 +38,11 @@ $LOCAL-VARIABLES: (
3738
position: sticky;
3839
top: pfe-local(offset, $region: nav);
3940
padding-left: 0;
40-
background-color: pfe-local(BackgroundColor);
41+
background-color: pfe-local(BackgroundColor, $fallback: transparent);
4142

4243
@media(min-width: pfe-breakpoint(lg)) {
4344
border: pfe-var(surface--border-width) pfe-var(surface--border-style) transparent;
44-
padding: pfe-local(vertical-spacer) pfe-local(horizontal-spacer);
45+
padding: pfe-local(Padding, $region: nav, $fallback: 0);
4546
}
4647

4748
.pfe-jump-links-nav__heading > h3,
@@ -119,7 +120,7 @@ nav {
119120
@media(min-width: pfe-breakpoint(lg)) {
120121
display: none;
121122
}
122-
123+
123124
&:last-child {
124125
padding-bottom: pfe-local(horizontal-spacer, $region: link);
125126
}
@@ -166,20 +167,35 @@ nav {
166167

167168
overflow-y: hidden;
168169
transition: flex 1s linear;
169-
170+
170171
li {
171172
border-left: none !important;
172173
}
173174
}
174175
}
175176

177+
//accordion padding override
178+
:host {
179+
--pfe-accordion__panel-container--Padding: 0;
180+
}
181+
182+
// 0 -> md breakpoint
183+
@media (max-width: pfe-breakpoint(md, $max: true)) {
184+
//accordion padding override
185+
:host {
186+
--pfe-accordion__panel-container--Padding: 20px;
187+
}
188+
}
189+
190+
176191
// --------------------- //
177192
// Set the local variable to use the accordion namespace temporarily
178193
$temp: $LOCAL;
179194
$LOCAL: accordion;
180195

181196
pfe-accordion {
182-
197+
198+
183199
pfe-accordion-header {
184200
// @TODO: When variables are available in accordion, remove theme changes from this file
185201
// hide accordion left border:
@@ -194,6 +210,7 @@ pfe-accordion {
194210
pfe-accordion-panel {
195211
// hide accordion left border:
196212
border-left-color: transparent;
213+
border-right: none;
197214
}
198215

199216
// 0 -> LG breakpoint
@@ -220,7 +237,7 @@ pfe-accordion {
220237
display: none;
221238
opacity: 1;
222239
display: block;
223-
240+
224241
> pfe-jump-links-nav {
225242
width: 100%;
226243
display: block;
@@ -236,17 +253,11 @@ pfe-accordion {
236253
$LOCAL: $temp;
237254

238255
:host([color="darkest"]) {
239-
--pfe-jump-links--BackgroundColor: #{pfe-var(surface--darkest)};
240256
--pfe-jump-links--context: #{pfe-var(surface--darkest--context)};
241257

242-
border: pfe-var(surface--border-width) pfe-var(surface--border-style) pfe-var(ui-disabled--text);
243-
244258
pfe-accordion-header,
245259
pfe-accordion-panel,
246260
button[aria-expanded="true"] {
247-
--pfe-accordion--BackgroundColor: #{pfe-var(surface--darkest)};
248-
--pfe-accordion--context: #{pfe-var(surface--darkest--context)};
249-
250261
--pfe-jump-links--BackgroundColor: #{pfe-var(surface--darkest)};
251262
--pfe-jump-links--context: #{pfe-var(surface--darkest--context)};
252263
}
@@ -391,4 +402,3 @@ $LOCAL: $temp;
391402
:host([hidden]) {
392403
display: none;
393404
}
394-

elements/pfe-sass/mixins/_components.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
@mixin pfe-accordion-props($variant: default) {
8989
margin: 0;
9090
width: pfe-local(Width, 100%);
91-
max-width: calc(100% - #{pfe-var(surface--border-width--heavy)});
91+
max-width: 100%;
9292
height: auto;
9393
position: relative;
9494

@@ -245,4 +245,4 @@
245245
right: calc(#{pfe-var(container-spacer)} * 1.3125);
246246
}
247247
}
248-
}
248+
}

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
-737 Bytes
Loading
195 Bytes
Loading
-12 KB
Loading

0 commit comments

Comments
 (0)