Skip to content

Commit d9c58ad

Browse files
committed
Removed position fixed from pattern-info panel. Relatively positioned so it pushes entire page/pattern above it so not obstructing
1 parent b5e64ef commit d9c58ad

File tree

6 files changed

+167
-147
lines changed

6 files changed

+167
-147
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ node_modules/*
22
src/bower_components/*
33
.sass-cache/*
44
.DS_Store
5+
/.eslintignore

dist/styleguide/css/pattern-lab.css

Lines changed: 43 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
\*------------------------------------*/
7171
/**
7272
* The HTML and body elements for the Pattern Lab shell.
73-
* 1)These exist indepenedent of any project-specific styles
73+
* 1) These exist indepenedent of any project-specific styles
7474
* 2) Styled as IDs to avoid collisions with user <body> tag
7575
*/
7676
.pl-c-body {
@@ -824,13 +824,22 @@
824824
* 1) This wrapper div occupies all remaining viewport space after PL's header
825825
*/
826826
.pl-c-viewport {
827+
display: -webkit-box;
828+
display: -ms-flexbox;
829+
display: flex;
830+
-webkit-box-orient: vertical;
831+
-webkit-box-direction: normal;
832+
-ms-flex-direction: column;
833+
flex-direction: column;
834+
height: 100vh;
827835
width: 100%;
828-
position: fixed;
836+
position: relative;
829837
top: 2rem;
830838
bottom: 0;
831839
left: 0;
832840
right: 0;
833841
z-index: 0;
842+
overflow: hidden;
834843
}
835844

836845
/**
@@ -881,11 +890,11 @@
881890
left: 0;
882891
right: 0;
883892
background-color: #fff;
884-
/**
885-
* Hay Mode transition
886-
* 1) Hay Mode (disabled by default) starts with the smallest
887-
* viewport then slowly expands http://bradfrost.com/blog/post/ish-2-0/
888-
*/
893+
/**
894+
* Hay Mode transition
895+
* 1) Hay Mode (disabled by default) starts with the smallest
896+
* viewport then slowly expands http://bradfrost.com/blog/post/ish-2-0/
897+
*/
889898
}
890899
.pl-c-viewport__iframe.hay-mode {
891900
-webkit-transition: all 40s linear;
@@ -897,8 +906,11 @@
897906
* 1) Container used for manual resizing
898907
*/
899908
.pl-c-viewport__resizer {
909+
position: absolute;
910+
right: 0;
911+
top: 0;
912+
bottom: 0;
900913
width: 14px;
901-
float: right;
902914
margin: 0;
903915
height: 100%;
904916
cursor: move;
@@ -1121,7 +1133,7 @@
11211133
#PATTERN INFO
11221134
\*------------------------------------*/
11231135
/**
1124-
* 1) Pattern info contains two sidy-by-side panels that
1136+
* 1) Pattern info contains two side-by-side panels that
11251137
* house a pattern's information, such as title, lineage,
11261138
* code, annotations, and more.
11271139
*/
@@ -1226,7 +1238,7 @@
12261238
* 1) Right panel that displays the pattern's code (found in _tabs.scss)
12271239
* 2) Using a sibling selector because the pattern info isn't always present.
12281240
* The sibling selector allows the code panel to occupy the full width of
1229-
* the
1241+
* the modal
12301242
* 1) Cap the height of the code panel in the modal
12311243
*/
12321244
@media all and (min-width: 53em) {
@@ -1382,7 +1394,7 @@
13821394
#TABS
13831395
\*------------------------------------*/
13841396
/**
1385-
* 1) Tabs contain a set of horintally-arranged tabs
1397+
* 1) Tabs contain a set of horizontally-arranged tabs
13861398
* with accompanying panels. When a tab link is clicked
13871399
* the corresponding panel becomes visible
13881400
*/
@@ -1765,7 +1777,7 @@
17651777

17661778
/**
17671779
* Annotations Title
1768-
* Says the world "Annotations"
1780+
* Says the word "Annotations"
17691781
*/
17701782
.pl-c-annotations__title {
17711783
font-size: 1.2rem !important;
@@ -1834,34 +1846,35 @@
18341846
#MODAL
18351847
\*------------------------------------*/
18361848
/**
1837-
* 1) The modal slides up from the bottom of the viewport when
1849+
* 1) The modal slides up from the bottom of the viewport when
18381850
* "show pattern info" is selected on the pattern detail screen.
18391851
*/
18401852
.pl-c-modal {
1853+
display: none;
18411854
font-family: "HelveticaNeue", "Helvetica", "Arial", sans-serif;
18421855
background: #000;
18431856
color: #ccc;
1844-
position: fixed;
1857+
position: relative;
18451858
top: auto;
1846-
bottom: -50%;
1859+
bottom: 0;
18471860
left: 0;
18481861
z-index: 5;
18491862
width: 100%;
18501863
height: 50%;
1864+
-webkit-transition: bottom 0.3s ease-out;
1865+
transition: bottom 0.3s ease-out;
1866+
/**
1867+
* Active modal
1868+
*/
1869+
}
1870+
.pl-c-modal.pl-is-active {
18511871
display: -webkit-box;
18521872
display: -ms-flexbox;
18531873
display: flex;
18541874
-webkit-box-orient: vertical;
18551875
-webkit-box-direction: normal;
18561876
-ms-flex-direction: column;
18571877
flex-direction: column;
1858-
-webkit-transition: bottom 0.3s ease-out;
1859-
transition: bottom 0.3s ease-out;
1860-
/**
1861-
* Active modal
1862-
*/
1863-
}
1864-
.pl-c-modal.pl-is-active {
18651878
bottom: 0;
18661879
}
18671880

@@ -1886,10 +1899,10 @@
18861899
z-index: 2;
18871900
-webkit-transition: all 0.1s ease-out;
18881901
transition: all 0.1s ease-out;
1889-
/**
1890-
* Modal close button inside active modal
1891-
* 1) Move modal button outside of the modal window
1892-
*/
1902+
/**
1903+
* Modal close button inside active modal
1904+
* 1) Move modal button outside of the modal window
1905+
*/
18931906
}
18941907
.pl-c-modal__close-btn:hover, .pl-c-modal__close-btn:focus {
18951908
background: #222;
@@ -2041,7 +2054,7 @@
20412054
#VISIBILITY
20422055
\*------------------------------------*/
20432056
/**
2044-
* Visibilly hidden but still accessible to screen readers
2057+
* Visibly hidden but still accessible to screen readers
20452058
*/
20462059
.is-vishidden {
20472060
position: absolute !important;
@@ -2063,7 +2076,7 @@
20632076
* Using Twitter Typeahead to autocomplete pattern
20642077
* searches. https://twitter.github.io/typeahead.js/
20652078
* 1) Wrapped in pl-c-header to contain styles for projects that
2066-
* might be using Typeahead in their own projects
2079+
* might already be using Typeahead
20672080
*/
20682081
.pl-c-header {
20692082
/**
@@ -2321,7 +2334,7 @@ pre.line-numbers > code {
23212334
}
23222335

23232336
/*------------------------------------*\
2324-
#VENDOR
2337+
#THEMES
23252338
\*------------------------------------*/
23262339
/*------------------------------------*\
23272340
#LIGHT THEME
@@ -2445,11 +2458,7 @@ pre.line-numbers > code {
24452458
\*------------------------------------*/
24462459
/**
24472460
* A theme that adjusts the density of the PL UI.
2448-
* Options are comapct (default), cozy, and comfortable
2449-
*/
2450-
/**
2451-
* A theme that adjusts the density of the PL UI.
2452-
* Options are default (compact), cozy, and comfortable
2461+
* Options are compact (default), cozy, and comfortable
24532462
*/
24542463
.pl-c-body--theme-density-cozy {
24552464
/**

dist/styleguide/js/patternlab-pattern.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ window.addEventListener("message", receiveIframeMessage, false);
9999
* Licensed under the MIT license
100100
*
101101
* Helps handle the initial iFrame source. Parses a string to see if it matches
102-
* an expected pattern in Pattern Lab. Supports Pattern Labs fuzzy pattern partial
102+
* an expected pattern in Pattern Lab. Supports Pattern Lab's fuzzy pattern partial
103103
* matching style.
104104
*
105105
*/
@@ -459,7 +459,7 @@ var modalStyleguide = {
459459
*/
460460
close: function (patternPartial) {
461461

462-
// not that the modal viewer is no longer active
462+
// note that the modal viewer is no longer active
463463
modalStyleguide.active[patternPartial] = false;
464464

465465
// hide the modal, look at info-panel.js

dist/styleguide/js/patternlab-viewer.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ try {
190190
* Licensed under the MIT license
191191
*
192192
* Helps handle the initial iFrame source. Parses a string to see if it matches
193-
* an expected pattern in Pattern Lab. Supports Pattern Labs fuzzy pattern partial
193+
* an expected pattern in Pattern Lab. Supports Pattern Lab's fuzzy pattern partial
194194
* matching style.
195195
*
196196
*/
@@ -446,7 +446,7 @@ var modalViewer = {
446446
$('.pl-js-pattern-info-toggle').html("Hide Pattern Info");
447447
}
448448

449-
// make sure the modal viewer is not viewable, it's alway hidden by default. the pageLoad event determines when it actually opens
449+
// make sure the modal viewer is not viewable, it's always hidden by default. the pageLoad event determines when it actually opens
450450
modalViewer.hide();
451451

452452
// review the query strings in case there is something the modal viewer is supposed to handle by default
@@ -503,7 +503,7 @@ var modalViewer = {
503503

504504
var obj;
505505

506-
// not that the modal viewer is no longer active
506+
// note that the modal viewer is no longer active
507507
DataSaver.updateValue('modalActive', 'false');
508508
modalViewer.active = false;
509509

@@ -529,7 +529,7 @@ var modalViewer = {
529529
},
530530

531531
/**
532-
* insert the copy for the modal window. if it's meant to be sent back to the iframe do do
532+
* insert the copy for the modal window. if it's meant to be sent back to the iframe, do that.
533533
* @param {String} the rendered template that should be inserted
534534
* @param {String} the patternPartial that the rendered template is related to
535535
* @param {Boolean} if the refresh is of a view-all view and the content should be sent back

src/sass/scss/components/_modal.scss

Lines changed: 54 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,80 +3,83 @@
33
\*------------------------------------*/
44

55
/**
6-
* 1) The modal slides up from the bottom of the viewport when
6+
* 1) The modal slides up from the bottom of the viewport when
77
* "show pattern info" is selected on the pattern detail screen.
88
*/
99
.pl-c-modal {
10-
font-family: $pl-font;
11-
background: $pl-color-black;
12-
color: $pl-color-gray-20;
13-
position: fixed;
14-
top: auto;
15-
bottom: -50%;
16-
left: 0;
17-
z-index: 5;
18-
width: 100%;
19-
height: 50%;
20-
display: flex;
21-
flex-direction: column;
22-
transition: bottom 0.3s ease-out;
10+
display: none;
11+
font-family: $pl-font;
12+
background: $pl-color-black;
13+
color: $pl-color-gray-20;
14+
position: relative;
15+
top: auto;
16+
bottom: 0;
17+
left: 0;
18+
z-index: 5;
19+
width: 100%;
20+
height: 50%;
21+
transition: bottom 0.3s ease-out;
2322

24-
/**
23+
/**
2524
* Active modal
2625
*/
27-
&.pl-is-active {
28-
bottom: 0;
29-
}
26+
&.pl-is-active {
27+
display: flex;
28+
flex-direction: column;
29+
bottom: 0;
30+
}
3031
}
3132

3233
/**
3334
* Modal close button
3435
* 1) Closes the modal popup
3536
*/
3637
.pl-c-modal__close-btn {
37-
font-size: 70%;
38-
background: $pl-color-black;
39-
color: $pl-color-gray-50;
40-
border: 0;
41-
border-radius: $pl-border-radius-med $pl-border-radius-med 0 0;
42-
display: inline-block;
43-
padding: 0.5rem 0.5rem 0.3rem;
44-
margin: 0;
45-
text-decoration: none;
46-
cursor: pointer;
47-
position: absolute;
48-
right: 0;
49-
bottom: 0;
50-
z-index: 2;
51-
transition: all $pl-animate-quick ease-out;
38+
font-size: 70%;
39+
background: $pl-color-black;
40+
color: $pl-color-gray-50;
41+
border: 0;
42+
border-radius: $pl-border-radius-med $pl-border-radius-med 0 0;
43+
display: inline-block;
44+
padding: 0.5rem 0.5rem 0.3rem;
45+
margin: 0;
46+
text-decoration: none;
47+
cursor: pointer;
48+
position: absolute;
49+
right: 0;
50+
bottom: 0;
51+
z-index: 2;
52+
transition: all $pl-animate-quick ease-out;
5253

53-
&:hover, &:focus {
54-
background: $pl-color-gray-87;
55-
color: $pl-color-white;
56-
}
54+
&:hover,
55+
&:focus {
56+
background: $pl-color-gray-87;
57+
color: $pl-color-white;
58+
}
5759

58-
&:focus, &:active {
59-
outline: 1px dotted $pl-color-gray-50;
60-
outline-offset: -2px;
61-
}
60+
&:focus,
61+
&:active {
62+
outline: 1px dotted $pl-color-gray-50;
63+
outline-offset: -2px;
64+
}
6265

63-
/**
66+
/**
6467
* Modal close button inside active modal
6568
* 1) Move modal button outside of the modal window
6669
*/
67-
.pl-c-modal.pl-is-active & {
68-
bottom: 100%; /* 1 */
69-
}
70+
.pl-c-modal.pl-is-active & {
71+
bottom: 100%; /* 1 */
72+
}
7073
}
7174

7275
/**
7376
* Close button icon
7477
* 1) Displayed as an e
7578
*/
7679
.pl-c-modal__close-btn-icon {
77-
width: 12px;
78-
height: 12px;
79-
color: currentColor;
80-
fill: currentColor;
81-
transition: fill $pl-animate-quick ease-out;
82-
}
80+
width: 12px;
81+
height: 12px;
82+
color: currentColor;
83+
fill: currentColor;
84+
transition: fill $pl-animate-quick ease-out;
85+
}

0 commit comments

Comments
 (0)