|
| 1 | +--- |
| 2 | +import { functionTypePrettyName } from '@src/utils/functions'; |
| 3 | +--- |
| 4 | +<div class="page-title-container"> |
| 5 | + <h1>{Astro.props.entry.data.title}</h1> |
| 6 | + |
| 7 | + <div class="type-badge type-badge--client">{functionTypePrettyName['client']}</div> |
| 8 | + <div class="type-badge type-badge--server">{functionTypePrettyName['server']}</div> |
| 9 | + <div class="type-badge type-badge--shared">{functionTypePrettyName['shared']}</div> |
| 10 | +</div> |
| 11 | + |
| 12 | +<style is:global> |
| 13 | + .show-type-badge-client { |
| 14 | + --selected-type-color: var(--color-type-client); |
| 15 | + } |
| 16 | + .show-type-badge-server { |
| 17 | + --selected-type-color: var(--color-type-server); |
| 18 | + } |
| 19 | + .show-type-badge-shared { |
| 20 | + --selected-type-color: var(--color-type-shared); |
| 21 | + } |
| 22 | + |
| 23 | + .show-type-badge-client .type-badge--client { |
| 24 | + display: block; |
| 25 | + } |
| 26 | + .show-type-badge-server .type-badge--server { |
| 27 | + display: block; |
| 28 | + } |
| 29 | + .show-type-badge-shared .type-badge--shared { |
| 30 | + display: block; |
| 31 | + } |
| 32 | +</style> |
| 33 | + |
| 34 | +<style> |
| 35 | + .type-badge { |
| 36 | + font-size: 12px; |
| 37 | + border-radius: .25rem; |
| 38 | + text-transform: uppercase; |
| 39 | + font-weight: bold; |
| 40 | + display: none; |
| 41 | + } |
| 42 | + |
| 43 | + .type-badge.type-badge--client { |
| 44 | + color: var(--color-type-client); |
| 45 | + } |
| 46 | + .type-badge.type-badge--server { |
| 47 | + color: var(--color-type-server); |
| 48 | + } |
| 49 | + .type-badge.type-badge--shared { |
| 50 | + color: var(--color-type-shared); |
| 51 | + } |
| 52 | + |
| 53 | + h1 { |
| 54 | + font-size: var(--sl-text-h1); |
| 55 | + line-height: var(--sl-line-height-headings); |
| 56 | + font-weight: 600; |
| 57 | + color: var(--sl-color-white); |
| 58 | + } |
| 59 | + |
| 60 | + .page-title-container { |
| 61 | + display: flex; |
| 62 | + justify-content: flex-start; |
| 63 | + align-items: flex-start; |
| 64 | + flex-direction: column; |
| 65 | + border-bottom: 1px solid var(--selected-type-color); |
| 66 | + padding-bottom: 1.5rem; |
| 67 | + margin-bottom: calc(-1.5rem - 1px); |
| 68 | + position: relative; |
| 69 | + } |
| 70 | + |
| 71 | + @media (width >= 48rem) { |
| 72 | + .type-badge { |
| 73 | + font-size: initial; |
| 74 | + padding: .15rem 1.5rem; |
| 75 | + } |
| 76 | + |
| 77 | + .type-badge.type-badge--client { |
| 78 | + background-color: var(--color-type-client-background); |
| 79 | + border: 1px solid var(--color-type-client); |
| 80 | + } |
| 81 | + .type-badge.type-badge--server { |
| 82 | + background-color: var(--color-type-server-background); |
| 83 | + border: 1px solid var(--color-type-server); |
| 84 | + } |
| 85 | + .type-badge.type-badge--shared { |
| 86 | + background-color: var(--color-type-shared-background); |
| 87 | + border: 1px solid var(--color-type-shared); |
| 88 | + } |
| 89 | + |
| 90 | + .page-title-container { |
| 91 | + justify-content: space-between; |
| 92 | + align-items: center; |
| 93 | + flex-direction: row; |
| 94 | + margin-top: 1rem; |
| 95 | + } |
| 96 | + } |
| 97 | +</style> |
0 commit comments