Skip to content

Commit e857c3f

Browse files
authored
feat(mistica-css): style any a element inside mistica-text as text link (#1382)
WEB-2249
1 parent 2e09c14 commit e857c3f

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

css/mistica-common.css

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,6 @@
232232
line-height: var(--mistica-line-height-tabsLabel);
233233
font-weight: var(--mistica-font-weight-tabsLabel);
234234
}
235-
.mistica-text-link {
236-
font-size: var(--mistica-font-size-link);
237-
line-height: var(--mistica-line-height-link);
238-
font-weight: var(--mistica-font-weight-link);
239-
-webkit-tap-highlight-color: transparent;
240-
}
241235
.mistica-text-title1 {
242236
color: var(--vcolor-textSecondary);
243237
text-transform: uppercase;
@@ -484,7 +478,8 @@ label.mistica-chip > input:checked + span {
484478

485479
/* TextLink */
486480

487-
.mistica-text-link {
481+
.mistica-text-link,
482+
[class^='mistica-text'] a {
488483
color: var(--vcolor-textLink);
489484
font-weight: inherit;
490485
font-size: inherit;
@@ -495,14 +490,18 @@ label.mistica-chip > input:checked + span {
495490
}
496491

497492
@media (pointer: fine) {
498-
.mistica-text-link:hover:not([disabled]) {
493+
.mistica-text-link:hover:not([disabled]),
494+
[class^='mistica-text'] a:hover:not([disabled]) {
499495
text-decoration-thickness: 0.125em;
500496
}
501497
}
502498

503-
.mistica-text-link[disabled] {
499+
.mistica-text-link[disabled],
500+
[class^='mistica-text'] a[disabled] {
504501
opacity: 0.5;
505502
text-decoration: none;
503+
cursor: default;
504+
pointer-events: none;
506505
}
507506

508507
/* Breadcrumbs */

examples/css/index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ <h1 class="mistica-text-title4">Title 4</h1>
7070
<h3 class="mistica-text-title2">TextLink</h3>
7171
<p class="mistica-text-2">
7272
This is an example of <a class="mistica-text-link" href="#">text link</a> inside text2 and
73-
this is a <a class="mistica-text-link" href="#" disabled>disabled text link</a> too.
73+
this is a <a class="mistica-text-link" href="#" disabled>disabled text link</a> too. You
74+
don't need to add any extra class to &lt;a&gt; elements to make them look like mistica
75+
text links, just put the &lt;a&gt; element inside a .mistica-text-X ancestor. For example,
76+
this is a <a href="#">text link</a> too.
7477
</p>
7578

7679
<h3 class="mistica-text-title2">Boxed</h3>

0 commit comments

Comments
 (0)