Skip to content

Commit 93c5e99

Browse files
eyevanakylebuch8
authored andcommitted
fix: Maintain circled pfe-icon height in flex display (#578)
* Align items in the center and maintain their height * Switch to flex-start from center * Update changelog * fixing boolean logic in storybook utils * adding circled as a storybook option * making the pfe-icon show up square (ex. 64x64)
1 parent c01a97f commit 93c5e99

File tree

5 files changed

+20
-11
lines changed

5 files changed

+20
-11
lines changed

.storybook/utils.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ const listProperties = (obj) =>
3232
let v = set[1];
3333
let print = set[2];
3434

35+
// exit if the value is a boolean and is false
36+
if (typeof v === "boolean" && !v) {
37+
return;
38+
}
39+
3540
// If no print value is provided, default to true
3641
if (typeof print === "undefined") {
3742
print = true;
@@ -44,11 +49,8 @@ const listProperties = (obj) =>
4449
(v !== null && v !== "null")
4550
) {
4651
string += p;
47-
// If the value is a boolean and is false, or the value is not a string true
48-
if (
49-
(typeof v === "string" && v !== "true") ||
50-
(typeof v === "boolean" && !v)
51-
) {
52+
// If the value is a string and the value is not equal to the string "true"
53+
if (typeof v === "string" && v !== "true") {
5254
string += "=";
5355
if (typeof v === "string") {
5456
// If it's a string, use quotation marks around it

CHANGELOG-prerelease.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ Tag: [v1.0.0-prerelease.26](https://github.com/patternfly/patternfly-elements/re
1111
- [27a97e1](https://github.com/patternfly/patternfly-elements/commit/27a97e135986de37ede55504a1630bf974de0e0c) pfe-cta: fix functions & IE11 accessibility
1212
- [9a39ae3](https://github.com/patternfly/patternfly-elements/commit/9a39ae3b7d0b8d129a3aea3b58e71dab5013c721) fix: Adding object-fit to resolve image distortion in cards, #417
1313
- [980203b](https://github.com/patternfly/patternfly-elements/commit/980203b2768d1d9d8813f386bb0f0bf37d3732ab) feat: Upgrade to latest version of storybook (#366)
14-
- [ab5bc0e](https://github.com/patternfly/patternfly-elements/commit/ab5bc0e66b1e0f2f4ba180ff80d24b84d0db3260) feat: added sm md and xl sizes for pfe-progress-indicator (#575)
14+
- [ab5bc0e](https://github.com/patternfly/patternfly-elements/commit/ab5bc0e66b1e0f2f4ba180ff80d24b84d0db3260) feat: added sm md and xl sizes for pfe-progress-indicator (#575)
1515
- [fc51ba](https://github.com/patternfly/patternfly-elements/commit/fc51baf1cb4313ca117cc505ba9c0e99dd44d0e9) feat: Add pfe-number schema (#576)
1616
- [](https://github.com/patternfly/patternfly-elements/commit/) fix: pfe-card: storybook issue with incorrect attribute (#573)
1717
- []() Upgrade to latest version of storybook (#366)
1818
- [](https://github.com/patternfly/patternfly-elements/commit/) pfe-datetime: adding a json schema
19+
- [](https://github.com/patternfly/patternfly-elements/commit/) pfe-icon-panel: maintain icon height in flex display
1920

2021
## Prerelease 25 ( 2019-09-10 )
2122

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ $pfe-icon-panel__icon-padding: .05em;
1616
:host {
1717
display: flex;
1818
align-content: flex-start;
19+
align-items: flex-start;
1920
flex-direction: column;
2021

2122
@media (min-width: $pfe-global--grid-breakpoint--sm) {
@@ -29,7 +30,6 @@ $pfe-icon-panel__icon-padding: .05em;
2930

3031
margin-right: var(--pfe-icon--spacing);
3132
font-size: var(--pfe-icon--size);
32-
line-height: var(--pfe-icon--size);
3333
padding: $pfe-icon-panel__icon-padding;
3434
min-width: var(--pfe-icon--size);
3535
max-width: var(--pfe-icon--size);

elements/pfe-icon/src/pfe-icon.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@
4949
],
5050
"default": "default",
5151
"prefixed": false
52+
},
53+
"circled": {
54+
"title": "Circled",
55+
"type": "boolean",
56+
"prefixed": false
5257
}
5358
}
5459
}

elements/pfe-icon/src/pfe-icon.scss

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ $pfe-icon--border-style: #{pfe-var(ui--border-style)};
3030

3131
position: relative;
3232
display: inline-block;
33+
line-height: 0;
3334

3435
@at-root #{&}([data-block]) {
3536
display: block;
@@ -59,12 +60,12 @@ $pfe-icon--border-style: #{pfe-var(ui--border-style)};
5960
}
6061

6162
@supports (-ms-accelerator:true) {
62-
/* IE Edge 12+ CSS */
63+
/* IE Edge 12+ CSS */
6364
@include greyscale-fallback();
6465
}
6566

6667
@supports (-ms-ime-align:auto) {
67-
/* IE Edge 16+ CSS */
68+
/* IE Edge 16+ CSS */
6869
@include greyscale-fallback();
6970
}
7071

@@ -139,11 +140,11 @@ $pfe-icon--border-style: #{pfe-var(ui--border-style)};
139140
--pfe-icon--BackgroundColor: transparent;
140141
--pfe-icon--BorderColor: transparent;
141142
--pfe-icon--Padding: 0;
142-
143+
143144
::slotted(*:first-child) {
144145
margin-top: 0;
145146
}
146-
147+
147148
::slotted(*:last-child) {
148149
margin-bottom: 0;
149150
}

0 commit comments

Comments
 (0)