From 089d9ac0b3de92225ae4d65cfba046e54340d7a2 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Tue, 28 May 2024 16:56:39 -0400 Subject: [PATCH] feat(card): make inline promo a WC variant --- elements/rh-card/demo/inline-promo.html | 274 +++++------------------- elements/rh-card/rh-card.css | 172 +++++++++++++++ elements/rh-card/rh-card.ts | 22 +- 3 files changed, 251 insertions(+), 217 deletions(-) diff --git a/elements/rh-card/demo/inline-promo.html b/elements/rh-card/demo/inline-promo.html index 2190d12135..8ef042fec4 100644 --- a/elements/rh-card/demo/inline-promo.html +++ b/elements/rh-card/demo/inline-promo.html @@ -1,114 +1,71 @@ - -
-
-
-

Left aligned with image

-

You can customize the #body by using the ::part selector. Using this technique, you can have padding on the top, bottom, left, right, or none at all.

- - Call to action - -
-
- - A placeholder image in a card header slot - - - - -
-
-
+ + + A placeholder image in a card header slot + + + + + +

Featured: left aligned with image

+

You can customize the #body by using the ::part selector. Using this technique, you can have padding on the top, bottom, left, right, or none at all.

+ + Call to action +
- -
-
-
-

Right aligned with image

-

This variant uses the same markup in the same order with one additional class: .right-aligned-with-image. Using CSS, we then change the order on larger viewports.

- - Call to action - -
-
- - A placeholder image in a card header slot - - - - -
-
-
+ + + A placeholder image in a card header slot + + + + +

Featured: right aligned with image

+

This variant uses the same markup in the same order with one additional attribute/property on the custom element: reverse.

+ + Call to action +
- -
-
-
-

No image is okay too

-

Sometimes, you may not have an image to go with your card. This variant shows how that might look.

- - Call to action - -
-
-
+ +

Featured: no image is okay too

+

Sometimes, you may not have an image to go with your card. Add the one-col attribute/property on the custom element.

+ + Call to action +
- -
-
-
-

Full Bleed

-

This version doesn't have a border or padding on the sides and will expand to the width of the container you put it in. These customizations are done via the ::part() selector.

- - Call to action - -
-
- - A placeholder image in a card header slot - - - - -
-
-
+ + + A placeholder image in a card header slot + + + + +

Full Width Inline Promo

+

This version doesn't have a border or padding on the sides on large viewports and will expand to the width of the container you put it in. Like the previous two examples, you can add the reverse or one-col attributes to change the look of this variant.

+ + Call to action +
+
+ +

Full Width Inline Promo - No Image

+

Just like the last version, except this version doesn't have an image.

+ + Call to action + +
+
- -
-
-
-

This is the standard inline promo. It has a paragraph and a call to action.

-
-
- - Call to action - -
-
-
-
- - -
-
-
-

This is the standard inline promo with a dark theme, styled via ::part().

-
-
- - Call to action - -
-
-
+ + + Call to action + +

This is the "standard" inline promo. It has a paragraph and a call to action.