Skip to content

Commit 29780ab

Browse files
authored
Merge pull request #761 from patternfly/feat-issue-741-add-event-cta
feat: Add event emission to pfe-cta (#741)
2 parents fbc251b + 072b2ca commit 29780ab

File tree

7 files changed

+494
-327
lines changed

7 files changed

+494
-327
lines changed

CHANGELOG-prerelease.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
Tag: [v1.0.0-prerelease.42](https://github.com/patternfly/patternfly-elements/releases/tag/v1.0.0-prerelease.42)
44

5-
- [](https://github.com/patternfly/patternfly-elements/commit/) fix: set consistent line-height for pfe-nav triggers (#773)
6-
5+
- [fbc251b](https://github.com/patternfly/patternfly-elements/commit/fbc251b5180684da26a57c0941235d57f961990e) fix: set consistent line-height for pfe-nav triggers (#773)
6+
- [](https://github.com/patternfly/patternfly-elements/commit/) feat: adding event to pfe-cta component
77

88
## Prerelease 41 ( 2020-03-19 )
99

elements/pfe-cta/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,12 @@ If you'd like to checkout how theming is possible using our CSS Var hooks, try a
131131
</style>
132132
```
133133

134+
## Events
135+
136+
### pfe-cta:select
137+
138+
This event is fired when a link is clicked and serves as a way to capture click events if necessary.
139+
134140
## Test
135141

136142
npm run test

elements/pfe-cta/demo/demo.css

Lines changed: 61 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ h2 {
33
margin: 15px 0 10px;
44
}
55

6-
hr {
7-
border-bottom: 1px solid #ddd;
8-
width: 100%;
9-
}
10-
116
pfe-band {
127
--pfe-band--Padding--horizontal: 60px;
138
--pfe-band--Width: 100%;
@@ -17,42 +12,91 @@ pfe-band[pfe-color="lightest"] pfe-card[pfe-color="lightest"] {
1712
--pfe-card--Border: 1px solid rgba(45, 45, 45, 0.3);
1813
}
1914

15+
.default-link-test {
16+
display: flex;
17+
flex-flow: row nowrap;
18+
border: 1px solid #ddd;
19+
width: 305px;
20+
padding: 10px;
21+
}
22+
2023
.resize {
2124
resize: horizontal;
2225
overflow: auto;
23-
border: 1px solid #ddd;
24-
width: 700px;
25-
padding: 10px;
2626
}
2727

28-
.resize>pfe-cta:first-child {
28+
.resize > pfe-cta:first-child {
2929
margin-right: 20px;
3030
}
3131

32+
.cta-layout,
3233
.card-layout {
3334
display: flex;
3435
flex-flow: row wrap;
35-
display: grid;
36-
grid-gap: 10px;
37-
grid-template-columns: repeat(auto-fit, minmax(100px, max-content));
3836
margin-top: -10px;
3937
margin-left: -20px;
38+
@supports (display: grid) {
39+
display: grid;
40+
grid-row-gap: 10px;
41+
grid-column-gap: 20px;
42+
grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
43+
margin-top: 0;
44+
margin-left: 0;
45+
}
46+
}
47+
48+
.cta-layout > *:not([class~="layout"]),
49+
.card-layout .cta-align > * {
50+
margin-top: 10px;
51+
margin-left: 20px;
52+
@supports (display: grid) {
53+
margin-top: 0;
54+
margin-left: 0;
55+
}
4056
}
4157

42-
.card-layout>pfe-cta,
43-
.card-layout .cta-align>pfe-cta {
58+
.card-layout > *:not([class~="layout"]) {
59+
width: min-content;
60+
min-width: 350px;
61+
flex-grow: 1;
4462
margin-top: 10px;
4563
margin-left: 20px;
4664
}
4765

66+
.cta-layout {
67+
grid-template-columns: repeat(auto-fit, minmax(max-content, 1fr));
68+
}
69+
70+
.event-registry {
71+
flex-grow: 1;
72+
display: flex;
73+
align-items: center;
74+
font-size: var(--pfe-theme--font-size--zeta, 14px);
75+
}
76+
77+
.event-registry span {
78+
display: inline-block;
79+
padding: 5px 10px;
80+
}
81+
82+
.event-registry pfe-icon {
83+
--pfe-icon--Color: #444;
84+
float: left;
85+
}
86+
87+
.event-registry pfe-icon:not([on="light"]) {
88+
--pfe-icon--Color: #fff;
89+
float: left;
90+
}
91+
4892
.custom-dark-band {
49-
padding: 60px 15px;
93+
padding: 15px;
5094
background: #222;
5195
--theme: dark;
5296
}
5397

5498
.custom-saturated-band {
55-
padding: 60px 15px;
99+
padding: 15px;
56100
background: #0c8488;
57101
--theme: saturated;
58-
}
102+
}

0 commit comments

Comments
 (0)