@@ -5,10 +5,17 @@ interface Props {
55 subtitle? : string ;
66 target? : string ;
77}
8- withDefaults (defineProps <Props >(), {
8+ const props = withDefaults (defineProps <Props >(), {
99 subtitle: ' ' ,
1010 target: ' _self' ,
1111});
12+
13+ const headingPartOne = computed (() => {
14+ const arr = props .heading .split (' ' );
15+ arr .pop ();
16+ return arr .join (' ' );
17+ });
18+ const headingPartTwo = computed (() => props .heading .split (' ' ).pop ());
1219 </script >
1320
1421<template >
@@ -28,11 +35,14 @@ withDefaults(defineProps<Props>(), {
2835 </div >
2936 </div >
3037 <div >
31- <p class =" align-items-center d-flex font-weight-bold mb-0 text-blue-600" >
32- {{ heading }}
33- <icon-arrow-right
34- aria-hidden =" true"
35- class =" es-nav-cta-card-arrow flex-shrink-0 ml-25" />
38+ <p class =" font-weight-bold mb-0 text-blue-600" >
39+ {{ headingPartOne }}
40+ <span class =" text-nowrap" >
41+ {{ headingPartTwo }}
42+ <icon-arrow-right
43+ aria-hidden =" true"
44+ class =" es-nav-cta-card-arrow flex-shrink-0 position-relative" />
45+ </span >
3646 </p >
3747 <p
3848 v-if =" subtitle"
@@ -50,6 +60,12 @@ withDefaults(defineProps<Props>(), {
5060.es-nav-cta-card {
5161 border-width : 1px ;
5262
63+ /* override EsCard active state */
64+ & :active {
65+ border-color : variables .$blue-600 ;
66+ box-shadow : 0 0 0 1px variables .$blue-600 ;
67+ }
68+
5369 /* only apply a hover state if the device supports mouse hover */
5470 @media (hover ) {
5571 & :hover {
@@ -63,12 +79,22 @@ withDefaults(defineProps<Props>(), {
6379 }
6480 }
6581
82+ /* move the arrow slightly to the right on hover */
6683 .es-nav-cta-card-arrow {
67- margin-left : 0.75 rem !important ;
84+ transform : translateX ( 0.25 rem ) ;
6885 }
6986 }
7087 }
7188
89+ & -arrow {
90+ /* vertically center the icon relative to the text */
91+ top : -2px ;
92+
93+ @media not (prefers-reduced-motion ) {
94+ transition : variables .$transition-base ;
95+ }
96+ }
97+
7298 & -icon {
7399 /* you cannot animate radial gradient backgrounds, so apply it to a pseudo element and fade it in on hover */
74100 & ::after {
@@ -103,11 +129,5 @@ withDefaults(defineProps<Props>(), {
103129 transition : variables .$transition-base ;
104130 }
105131 }
106-
107- & -arrow {
108- @media not (prefers-reduced-motion ) {
109- transition : variables .$transition-base ;
110- }
111- }
112132}
113133 </style >
0 commit comments