Skip to content

Commit 4e2f6ae

Browse files
markcaronkylebuch8
authored andcommitted
Updating RH-CTA, its README, and CP-Theme's README (#149)
1 parent 2f1a054 commit 4e2f6ae

8 files changed

Lines changed: 99 additions & 13 deletions

File tree

elements/rh-cta/README.md

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,62 @@
1-
# WIP 🐣: RHElements Cta Element
1+
# WIP 🐣: RHElements CTA Element
2+
3+
`rh-cta` is a call-to-action (CTA) element, that stands out from regular hypertext links, and is used for linking users to webpages.
4+
5+
_Note: `rh-cta` is not a button, though it may look like one visually._
26

37
## Usage
48
```html
59
<rh-cta>
10+
<a href="https://github.com/">GitHub</a>
11+
</rh-cta>
12+
13+
<rh-cta priority="primary">
614
<a href="https://rhelements.github.io/">Learn more about RHElements</a>
715
</rh-cta>
16+
17+
<rh-cta priority="secondary">
18+
<a href="https://redhat.com/">Red Hat</a>
19+
</rh-cta>
820
```
921

1022
## Slots
1123

1224
### Default slot
1325

14-
We expect an anchor tag, `<a>`, to be the first child inside rh-cta element.
26+
We expect an anchor tag, `<a>` with an `href`, to be the first child inside `rh-cta` element.
27+
28+
## Styling
29+
30+
| Theme Var Hook | Description | Default |
31+
| -------------- | ----------- | ------- |
32+
| --rh-theme--color--ui-link | Link color for default CTA | $rh-color--ui-link |
33+
| --rh-theme--color--ui-link--hover | Hover color for default CTA | $rh-color--ui-link--hover |
34+
| --rh-theme--color--ui-link--focus | Focus color for default CTA | $rh-color--ui-link--focus |
35+
| --rh-theme--color--ui-accent | Color for Primary CTA | $rh-color--ui-accent |
36+
| --rh-theme--color--ui-accent--hover | Hover color for Primary CTA | $rh-color--ui-accent--hover |
37+
| --rh-theme--color--ui-accent--text | Text color for Primary CTA | $rh-color--ui-accent--text |
38+
| --rh-theme--color--ui-accent--text--hover | Hover text color for Primary CTA | $rh-color--ui-accent--text--hover |
39+
| --rh-theme--color--ui-base | Border & text color for Secondary CTA | $rh-color--ui-base |
40+
| --rh-theme--color--ui-base--hover | Hover color for Secondary CTA | $rh-color--ui-base--hover |
41+
| --rh-theme--color--ui-base--text | Background color for Secondary CTA | $rh-color--ui-base--text |
42+
| --rh-theme--color--ui-base--text--hover | Hover text color for Secondary CTA | $rh-color--ui-base--text--hover |
43+
| --rh-theme--color--text--on-dark | Link color for default CTA with `on="dark"` | $rh-color--text--on-dark |
44+
| --rh-theme--color--ui-link--on-dark--hover | Hover color for default CTA with `on="dark"` | $rh-color--ui-link--on-dark--hover |
45+
46+
### Testing Theme Var Hooks
47+
48+
If you'd like to checkout how theming is possible using our CSS Var hooks, try adding the following to the `<head>` of `./demo/index.html` before running `npm run test`. Feel free to customize the colors too!
49+
50+
```html
51+
<style>
52+
:root {
53+
--rh-theme--color--ui-accent: green;
54+
--rh-theme--color--ui-accent--hover: darkgreen;
55+
--rh-theme--color--ui-accent--text: white;
56+
--rh-theme--color--ui-accent--text--hover: white;
57+
}
58+
</style>
59+
```
1560

1661
## Test
1762

elements/rh-cta/demo/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<meta charset="utf-8">
55
<title>RHElements: rh-cta Demo</title>
66

7-
<!-- <link rel="stylesheet" href="../../../themes/cp-theme/cp-theme.css" /> -->
87
<link rel="stylesheet" href="http://overpass-30e2.kxcdn.com/overpass.css" />
8+
<!-- <link rel="stylesheet" href="../../../themes/cp-theme/cp-theme.css" /> -->
99

1010
<!-- uncomment the es5-adapter if you're using the umd version -->
1111
<script src="/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js"></script>

elements/rh-cta/rh-cta.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

elements/rh-cta/rh-cta.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

elements/rh-cta/rh-cta.umd.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)