Skip to content

Commit 9fd329e

Browse files
anujsinglaanujsibennypowers
authored
fix(panel): raised and bordered variants (#2436)
* fix(panel): raised and bordered variants * fix(panel): raised and bordered variants * docs: update .changeset/pf-panel-2402.md * fix(panel): fix firefox browser issue * fix(panel): fix z-index issue in the header --------- Co-authored-by: Anuj Singla <[email protected]> Co-authored-by: Benny Powers <[email protected]>
1 parent 939e030 commit 9fd329e

File tree

4 files changed

+64
-5
lines changed

4 files changed

+64
-5
lines changed

.changeset/pf-panel-2402.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@patternfly/elements": patch
3+
---
4+
5+
`<pf-panel>`: fixed raised and bordered variants

docs/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ main.blog {
324324
top: 0;
325325
left: 0;
326326
right: 0;
327-
z-index: 200;
327+
z-index: 300;
328328
}
329329

330330
.pf-bar {

elements/pf-panel/docs/pf-panel.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,52 @@
111111
</pf-panel>
112112
```
113113

114+
<h3>Scrollable with header and footer</h3>
115+
<pf-panel scrollable>
116+
<h3 slot="header">Header content</h3>
117+
<p>
118+
A couple of years ago the Computer Science Club at Bishop's University
119+
ran into a problem. Our student run computer lab was running
120+
unlicensed copies of a propriety operating system. The computers also
121+
had many unlicensed programs installed. It was a big mess. At that
122+
time we had to make an ethical decision. We had to decide whether we
123+
wanted to continue breaking the law or not. We decided against running
124+
software for which we didn't have licenses as it could lead to the lab
125+
being closed.
126+
</p>
127+
<p>
128+
A couple of years ago the Computer Science Club at Bishop's University
129+
ran into a problem. Our student run computer lab was running
130+
unlicensed copies of a propriety operating system. The computers also
131+
had many unlicensed programs installed. It was a big mess. At that
132+
time we had to make an ethical decision. We had to decide whether we
133+
wanted to continue breaking the law or not. We decided against running
134+
software for which we didn't have licenses as it could lead to the lab
135+
being closed.
136+
</p>
137+
<p>
138+
A couple of years ago the Computer Science Club at Bishop's University
139+
ran into a problem. Our student run computer lab was running
140+
unlicensed copies of a propriety operating system. The computers also
141+
had many unlicensed programs installed. It was a big mess. At that
142+
time we had to make an ethical decision. We had to decide whether we
143+
wanted to continue breaking the law or not. We decided against running
144+
software for which we didn't have licenses as it could lead to the lab
145+
being closed.
146+
</p>
147+
<p slot="footer">Footer content</p>
148+
</pf-panel>
149+
150+
```html
151+
<pf-panel scrollable>
152+
<h3 slot="header">Header content</h3>
153+
<p>
154+
Long content...
155+
</p>
156+
<p slot="footer">Footer content</p>
157+
</pf-panel>
158+
```
159+
114160
{% endband %}
115161

116162
{% renderSlots %}{% endrenderSlots %}

elements/pf-panel/pf-panel.css

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
--pf-c-panel--before--BorderWidth: 0;
1010
--pf-c-panel--before--BorderColor: var(--pf-global--BorderColor--100, #d2d2d2);
1111
--pf-c-panel--m-bordered--before--BorderWidth: var(--pf-global--BorderWidth--sm, 1px);
12-
--pf-c-panel--m-raised--BoxShadow: pfglobalvar(--pf-global--BoxShadow--md, 0 0.25rem 0.5rem 0rem rgba(3, 3, 3, 0.12), 0 0 0.25rem 0 rgba(3, 3, 3, 0.06));
12+
--pf-c-panel--m-raised--BoxShadow: var(--pf-global--BoxShadow--md, 0 0.25rem 0.5rem 0rem rgba(3, 3, 3, 0.12), 0 0 0.25rem 0 rgba(3, 3, 3, 0.06));
1313
--pf-c-panel--m-raised--ZIndex: var(--pf-global--ZIndex--sm, 200);
1414
--pf-c-panel__header--PaddingTop: var(--pf-global--spacer--md, 1rem);
1515
--pf-c-panel__header--PaddingRight: var(--pf-global--spacer--md, 1rem);
@@ -36,6 +36,7 @@
3636
max-width: var(--pf-c-panel--MaxWidth);
3737
background-color: var(--pf-c-panel--BackgroundColor);
3838
box-shadow: var(--pf-c-panel--BoxShadow);
39+
display: block;
3940
}
4041

4142
:host([variant="bordered"])::before {
@@ -44,14 +45,21 @@
4445
pointer-events: none;
4546
content: "";
4647
border:
47-
var(--pf-c-panel--before--BorderWidth,
48-
var(--pf-c-panel--m-bordered--before--BorderWidth,
49-
var(--pf-global--BorderWidth--sm, 1px)))
48+
var(--pf-c-panel--m-bordered--before--BorderWidth, var(--pf-global--BorderWidth--sm, 1px))
5049
solid
5150
var(--pf-c-panel--before--BorderColor,
5251
var(--pf-global--BorderColor--100, #d2d2d2));
5352
}
5453

54+
:host([variant="raised"])::before {
55+
position: absolute;
56+
inset: 0;
57+
pointer-events: none;
58+
content: "";
59+
box-shadow: var(--pf-c-panel--m-raised--BoxShadow, 0 0.25rem 0.5rem 0rem rgba(3, 3, 3, 0.12), 0 0 0.25rem 0 rgba(3, 3, 3, 0.06));
60+
z-index: var(--pf-c-panel--m-raised--ZIndex, var(--pf-global--ZIndex--sm, 200));
61+
}
62+
5563
:host([variant="raised"]) {
5664
--pf-c-panel--BoxShadow: var(--pf-c-panel--m-raised--BoxShadow,
5765
var(--pf-global--BoxShadow--md, 0 0.25rem 0.5rem 0rem rgba(3, 3, 3, 0.12), 0 0 0.25rem 0 rgba(3, 3, 3, 0.06)));

0 commit comments

Comments
 (0)