Skip to content

Commit 7a8149e

Browse files
Us250350 pfe-cta wrapping issues (#791)
* Adjustments to CTA width * Addition of centering for primary style buttons that has long wrapping text * Adjust demo file to prevent focus state issue from appearing on default cta
1 parent 9f83786 commit 7a8149e

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

CHANGELOG-prerelease.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Tag: [v1.0.0-prerelease.41](https://github.com/patternfly/patternfly-elements/re
55
- [](https://github.com/patternfly/patternfly-elements/commit/) feat: Add events to the generator
66
- [](https://github.com/patternfly/patternfly-elements/commit/) feat: pfe-tabs keep history on tab click and open tab based on url parameters #786
77
- [](https://github.com/patternfly/patternfly-elements/commit/) feat: pfe-health-index size="mini" version #789
8+
- [](https://github.com/patternfly/patternfly-elements/commit/) fix: pfe-cta text wrapping issues
89

910
## Prerelease 40 ( 2020-03-10 )
1011

elements/pfe-cta/demo/demo.css

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@ pfe-band[pfe-color="lightest"] pfe-card[pfe-color="lightest"] {
1818
}
1919

2020
.resize {
21-
display: flex;
22-
flex-flow: row nowrap;
2321
resize: horizontal;
2422
overflow: auto;
2523
border: 1px solid #ddd;
26-
width: 500px;
24+
width: 700px;
2725
padding: 10px;
2826
}
2927

elements/pfe-cta/demo/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ <h3 slot="pfe-card--header"><code>pfe-color="complement"</code></h3>
214214
<h3>Force wrap to test arrow line-wrap</h3>
215215
<div class="resize">
216216
<pfe-cta><a href="https://www.redhat.com">Default link cta with longer text</a></pfe-cta>
217-
<pfe-cta><button>Default button cta with longer text</button></pfe-cta>
217+
<pfe-cta><button>Default button cta: arrow won't wrap correctly</button></pfe-cta>
218218
</div>
219219

220220
<br />

elements/pfe-cta/src/pfe-cta.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ $variables: (
4242
display: inline-block;
4343
position: relative;
4444
z-index: 0;
45-
max-width: max-content;
4645
vertical-align: middle;
4746
transition: padding #{pfe-var(animation-speed)} #{pfe-var(animation-timing)};
4847

@@ -118,6 +117,10 @@ $variables: (
118117
color: #{pfe-local(Color--hover)} !important;
119118
text-decoration: #{pfe-local(TextDecoration--hover)} !important;
120119
}
120+
121+
:host([pfe-priority]) & {
122+
text-align: center;
123+
}
121124
}
122125

123126
:host(:not([aria-disabled="true"])) ::slotted(*:not(:disabled)),
@@ -133,6 +136,7 @@ $variables: (
133136
&--wrapper {
134137
display: block;
135138
white-space: nowrap;
139+
min-width: 100%;
136140

137141
:host([pfe-priority]) &,
138142
:host([aria-disabled="true"]) & {

0 commit comments

Comments
 (0)