3 // Per ADR 04, Codex Links are implemented as a re-usable Less mixin rather
4 // than a Vue.js component. Users who wish to apply the Codex Link styles to
5 // elements on a page should call the mixin inside of the relevant selector in
6 // their own stylesheets. Variants (underlined links, red links) can be accessed
7 // by adding the appropriate modifier class (.is-underlined and .is-red-link,
10 // Code that needs to customize these modifier classes or otherwise customize the
11 // selectors used for these modifiers can use the following sub-mixins:
12 // - cdx-mixin-link-base(): base link styles
13 // - cdx-mixin-link-underlined(): underlined link (-base must also be applied)
14 // - cdx-mixin-link-red(): red link (-base must also be applied)
19 // .cdx-mixin-link-base();
21 // &.custom-underlined-class {
22 // .cdx-mixin-link-underlined();
25 // &.custom-red-link-class {
26 // .cdx-mixin-link-red();
30 // Link styles can be used inside of other Vue components, or anywhere that Less
31 // is available; JS is not required.
33 .cdx-mixin-link-base() {
34 color: @color-progressive;
35 border-radius: @border-radius-base;
36 text-decoration: @text-decoration-none;
39 color: @color-visited;
42 color: @color-visited--hover;
46 color: @color-visited--active;
51 color: @color-progressive--hover;
52 text-decoration: @text-decoration-underline;
56 color: @color-progressive--active;
57 text-decoration: @text-decoration-underline;
60 /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
62 outline: @border-style-base @border-width-thick @outline-color-progressive--focus;
65 @supports not selector( :focus-visible ) {
67 outline: @border-style-base @border-width-thick @outline-color-progressive--focus;
71 // Style external link icon.
72 // HACK: Make sure this doesn't apply to placeholder icons in TypeaheadSearch (T372420).
73 .cdx-icon:not( .cdx-thumbnail__placeholder__icon--vue ):last-child {
74 // Note, `@min-size-icon-x-small` & `@size-icon-small` are an approximation in our current
75 // 16/14 base font theme environment.
76 // We're faking it to make it, `@min-size-icon-x-small` is `12px` in both themes,
77 // `@size-icon-small` is `1em`, achieving the desired size.
78 min-width: @min-size-icon-x-small;
79 min-height: @min-size-icon-x-small;
80 width: @size-icon-small;
81 height: @size-icon-small;
82 padding-left: @spacing-25;
83 vertical-align: middle;
87 .cdx-mixin-link-underlined() {
88 text-decoration: @text-decoration-underline;
91 .cdx-mixin-link-red() {
92 color: @color-link-red;
95 color: @color-link-red--visited;
98 color: @color-link-red--visited--hover;
102 color: @color-link-red--visited--active;
107 color: @color-link-red--hover;
108 text-decoration: @text-decoration-underline;
112 color: @color-link-red--active;
113 text-decoration: @text-decoration-underline;
117 outline-color: @outline-color-progressive--focus;
122 .cdx-mixin-link-base();
124 // stylelint-disable-next-line selector-class-pattern
126 .cdx-mixin-link-underlined();
129 // stylelint-disable-next-line selector-class-pattern
131 .cdx-mixin-link-red();