| 1 |
@use '../../sass-utilities' as *; |
| 2 |
|
| 3 |
@include pf-root($code-editor) { |
| 4 |
// controls |
| 5 |
--#{$code-editor}__controls--PaddingInlineStart: var(--pf-t--global--spacer--sm); |
| 6 |
--#{$code-editor}__controls--Gap: var(--pf-t--global--spacer--gap--action-to-action--plain); |
| 7 |
|
| 8 |
// header |
| 9 |
--#{$code-editor}__header--before--BorderBlockEndWidth: var(--pf-t--global--border--width--box--default); // TODO - remove in breaking change |
| 10 |
--#{$code-editor}__header--before--BorderBlockEndColor: var(--pf-t--global--border--color--default); // TODO - remove in breaking change |
| 11 |
--#{$code-editor}__header--BorderWidth: var(--pf-t--global--border--width--box--default); |
| 12 |
--#{$code-editor}__header--BorderColor: var(--pf-t--global--border--color--default); |
| 13 |
--#{$code-editor}__header--BorderStartStartRadius: var(--pf-t--global--border--radius--medium); |
| 14 |
--#{$code-editor}__header--BorderStartEndRadius: var(--pf-t--global--border--radius--medium); |
| 15 |
|
| 16 |
// header content |
| 17 |
--#{$code-editor}__header-content--BackgroundColor: var(--pf-t--global--background--color--secondary--default); |
| 18 |
--#{$code-editor}__header-content--m-plain--BackgroundColor: transparent; |
| 19 |
--#{$code-editor}__header-content--PaddingBlockStart: var(--pf-t--global--spacer--xs); |
| 20 |
--#{$code-editor}__header-content--PaddingBlockEnd: var(--pf-t--global--spacer--xs); |
| 21 |
--#{$code-editor}__header-content--PaddingInlineStart: var(--pf-t--global--spacer--sm); |
| 22 |
--#{$code-editor}__header-content--PaddingInlineEnd: var(--pf-t--global--spacer--sm); |
| 23 |
--#{$code-editor}__header-content--BorderStartStartRadius: var(--pf-t--global--border--radius--medium); |
| 24 |
--#{$code-editor}__header-content--BorderStartEndRadius: var(--pf-t--global--border--radius--medium); |
| 25 |
|
| 26 |
// upload |
| 27 |
--#{$code-editor}__upload--PaddingInlineStart: var(--pf-t--global--spacer--md); |
| 28 |
--#{$code-editor}__upload--PaddingInlineEnd: var(--pf-t--global--spacer--md); |
| 29 |
--#{$code-editor}__upload--PaddingBlockStart: var(--pf-t--global--spacer--md); |
| 30 |
--#{$code-editor}__upload--PaddingBlockEnd: var(--pf-t--global--spacer--md); |
| 31 |
--#{$code-editor}__upload--BorderRadius: var(--pf-t--global--border--radius--medium); |
| 32 |
|
| 33 |
// main |
| 34 |
--#{$code-editor}__main--BorderColor: var(--pf-t--global--border--color--default); |
| 35 |
--#{$code-editor}__main--BorderWidth: var(--pf-t--global--border--width--box--default); |
| 36 |
--#{$code-editor}__main--BorderEndStartRadius: var(--pf-t--global--border--radius--medium); |
| 37 |
--#{$code-editor}__main--BorderEndEndRadius: var(--pf-t--global--border--radius--medium); |
| 38 |
--#{$code-editor}__main--BackgroundColor: var(--pf-t--global--background--color--primary--default); |
| 39 |
--#{$code-editor}--m-read-only__main--BackgroundColor: var(--pf-t--global--background--color--secondary--default); |
| 40 |
--#{$code-editor}__upload--before--BorderWidth: 0; |
| 41 |
--#{$code-editor}__upload--before--BorderColor: transparent; |
| 42 |
--#{$code-editor}__main--m-drag-hover--before--BorderWidth: var(--pf-t--global--border--width--divider--hover); |
| 43 |
--#{$code-editor}__main--m-drag-hover--before--BorderColor: var( --pf-t--global--border--color--clicked); |
| 44 |
--#{$code-editor}__main--m-drag-hover--after--BackgroundColor: var(--pf-t--global--background--color--primary--default); |
| 45 |
--#{$code-editor}__main--m-drag-hover--after--Opacity: .1; |
| 46 |
|
| 47 |
// code |
| 48 |
--#{$code-editor}__code--PaddingBlockStart: var(--pf-t--global--spacer--sm); |
| 49 |
--#{$code-editor}__code--PaddingInlineEnd: var(--pf-t--global--spacer--sm); |
| 50 |
--#{$code-editor}__code--PaddingBlockEnd: var(--pf-t--global--spacer--sm); |
| 51 |
--#{$code-editor}__code--PaddingInlineStart: var(--pf-t--global--spacer--sm); |
| 52 |
--#{$code-editor}__code-pre--FontSize: var(--pf-t--global--font--size--sm); |
| 53 |
--#{$code-editor}__code-pre--FontFamily: var(--pf-t--global--font--family--mono); |
| 54 |
|
| 55 |
// content |
| 56 |
--#{$code-editor}__header-main--PaddingInlineEnd: var(--pf-t--global--spacer--sm); |
| 57 |
--#{$code-editor}__header-main--PaddingInlineStart: var(--pf-t--global--spacer--sm); |
| 58 |
|
| 59 |
// tab |
| 60 |
--#{$code-editor}__tab--BackgroundColor: var(--pf-t--global--background--color--primary--default); |
| 61 |
--#{$code-editor}--m-read-only__tab--BackgroundColor: var(--#{$code-editor}--m-read-only__main--BackgroundColor); |
| 62 |
--#{$code-editor}__tab--Color: var(--pf-t--global--text--color--subtle); |
| 63 |
--#{$code-editor}__tab--PaddingBlockStart: var(--pf-t--global--spacer--sm); |
| 64 |
--#{$code-editor}__tab--PaddingInlineEnd: var( --pf-t--global--spacer--sm); |
| 65 |
--#{$code-editor}__tab--PaddingBlockEnd: var(--pf-t--global--spacer--sm); |
| 66 |
--#{$code-editor}__tab--PaddingInlineStart: var( --pf-t--global--spacer--sm); |
| 67 |
--#{$code-editor}__tab--BorderBlockStartWidth: var(--pf-t--global--border--width--box--default); |
| 68 |
--#{$code-editor}__tab--BorderInlineEndWidth: var(--pf-t--global--border--width--box--default); |
| 69 |
--#{$code-editor}__tab--BorderBlockEndWidth: 0; |
| 70 |
--#{$code-editor}__tab--BorderInlineStartWidth: var(--pf-t--global--border--width--box--default); |
| 71 |
--#{$code-editor}__tab--BorderColor: var(--pf-t--global--border--color--default); |
| 72 |
--#{$code-editor}__tab--BorderStartEndRadius: var(--pf-t--global--border--radius--medium); |
| 73 |
|
| 74 |
// tab text |
| 75 |
--#{$code-editor}__tab-icon--text--MarginInlineStart: var(--pf-t--global--spacer--sm); |
| 76 |
} |
| 77 |
|
| 78 |
.#{$code-editor} { |
| 79 |
display: flex; |
| 80 |
flex-direction: column; |
| 81 |
|
| 82 |
&.pf-m-read-only { |
| 83 |
--#{$code-editor}__tab--BackgroundColor: var(--#{$code-editor}--m-read-only__tab--BackgroundColor); |
| 84 |
--#{$code-editor}__main--BackgroundColor: var(--#{$code-editor}--m-read-only__main--BackgroundColor); |
| 85 |
} |
| 86 |
|
| 87 |
&.pf-m-full-height { |
| 88 |
height: 100%; |
| 89 |
} |
| 90 |
} |
| 91 |
|
| 92 |
.#{$code-editor}__container { |
| 93 |
display: flex; |
| 94 |
flex-grow: 1; |
| 95 |
flex-direction: column; |
| 96 |
} |
| 97 |
|
| 98 |
.#{$code-editor}__header { |
| 99 |
position: relative; |
| 100 |
display: flex; |
| 101 |
|
| 102 |
&::before, |
| 103 |
&::after { |
| 104 |
position: absolute; |
| 105 |
pointer-events: none; |
| 106 |
content: ""; |
| 107 |
} |
| 108 |
|
| 109 |
&::after { |
| 110 |
position: absolute; |
| 111 |
inset: 0; |
| 112 |
pointer-events: none; |
| 113 |
content: ""; |
| 114 |
border: var(--#{$code-editor}__header--BorderWidth) solid var(--#{$code-editor}__header--BorderColor); |
| 115 |
border-block-end-width: 0; |
| 116 |
border-start-start-radius: var(--#{$code-editor}__header--BorderStartStartRadius); |
| 117 |
border-start-end-radius: var(--#{$code-editor}__header--BorderStartEndRadius); |
| 118 |
} |
| 119 |
|
| 120 |
&::before { |
| 121 |
inset-block-end: 0; |
| 122 |
inset-inline-start: 0; |
| 123 |
inset-inline-end: 0; |
| 124 |
border-block-end: var(--#{$code-editor}__header--before--BorderBlockEndWidth) solid var(--#{$code-editor}__header--before--BorderBlockEndColor); |
| 125 |
} |
| 126 |
|
| 127 |
&.pf-m-plain { |
| 128 |
--#{$code-editor}__header--BorderWidth: 0; |
| 129 |
--#{$code-editor}__header-content--BackgroundColor: var(--#{$code-editor}__header-content--m-plain--BackgroundColor); |
| 130 |
} |
| 131 |
} |
| 132 |
|
| 133 |
.#{$code-editor}__header-content { |
| 134 |
display: flex; |
| 135 |
flex: 1; |
| 136 |
align-items: flex-end; |
| 137 |
padding-block-start: var(--#{$code-editor}__header-content--PaddingBlockStart); |
| 138 |
padding-block-end: var(--#{$code-editor}__header-content--PaddingBlockEnd); |
| 139 |
padding-inline-start: var(--#{$code-editor}__header-content--PaddingInlineStart); |
| 140 |
padding-inline-end: var(--#{$code-editor}__header-content--PaddingInlineEnd); |
| 141 |
background-color: var(--#{$code-editor}__header-content--BackgroundColor); |
| 142 |
border-start-start-radius: var(--#{$code-editor}__header-content--BorderStartStartRadius); |
| 143 |
|
| 144 |
&:last-child { |
| 145 |
border-start-end-radius: var(--#{$code-editor}__header-content--BorderStartEndRadius); |
| 146 |
} |
| 147 |
} |
| 148 |
|
| 149 |
.#{$code-editor}__controls { |
| 150 |
display: flex; |
| 151 |
gap: var(--#{$code-editor}__controls--Gap); |
| 152 |
align-items: flex-start; |
| 153 |
} |
| 154 |
|
| 155 |
.#{$code-editor}__header-main { |
| 156 |
flex-grow: 1; |
| 157 |
align-self: center; |
| 158 |
padding-inline-start: var(--#{$code-editor}__header-main--PaddingInlineStart); |
| 159 |
padding-inline-end: var(--#{$code-editor}__header-main--PaddingInlineEnd); |
| 160 |
} |
| 161 |
|
| 162 |
.#{$code-editor}__upload { |
| 163 |
position: relative; |
| 164 |
padding-block-start: var(--#{$code-editor}__upload--PaddingBlockStart); |
| 165 |
padding-block-end: var(--#{$code-editor}__upload--PaddingBlockEnd); |
| 166 |
padding-inline-start: var(--#{$code-editor}__upload--PaddingInlineStart); |
| 167 |
padding-inline-end: var(--#{$code-editor}__upload--PaddingInlineEnd); |
| 168 |
|
| 169 |
&::before { |
| 170 |
position: absolute; |
| 171 |
inset-block-start: var(--#{$code-editor}__upload--PaddingBlockStart); |
| 172 |
inset-block-end: var(--#{$code-editor}__upload--PaddingBlockEnd); |
| 173 |
inset-inline-start: var(--#{$code-editor}__upload--PaddingInlineStart); |
| 174 |
inset-inline-end: var(--#{$code-editor}__upload--PaddingInlineEnd); |
| 175 |
content: ""; |
| 176 |
border: var(--#{$code-editor}__upload--before--BorderWidth) dashed var(--#{$code-editor}__upload--before--BorderColor); |
| 177 |
border-radius: var(--#{$code-editor}__upload--BorderRadius); |
| 178 |
} |
| 179 |
} |
| 180 |
|
| 181 |
.#{$code-editor}__main { |
| 182 |
position: relative; |
| 183 |
flex-grow: 1; |
| 184 |
color: var(--#{$code-editor}__main--Color, inherit); |
| 185 |
background-color: var(--#{$code-editor}__main--BackgroundColor); |
| 186 |
border: var(--#{$code-editor}__main--BorderWidth) solid; |
| 187 |
border-color: var(--#{$code-editor}__main--BorderColor); |
| 188 |
border-end-start-radius: var(--#{$code-editor}__main--BorderEndStartRadius); |
| 189 |
border-end-end-radius: var(--#{$code-editor}__main--BorderEndEndRadius); |
| 190 |
|
| 191 |
&.pf-m-drag-hover { |
| 192 |
--#{$code-editor}__upload--before--BorderWidth: var(--#{$code-editor}__main--m-drag-hover--before--BorderWidth); |
| 193 |
--#{$code-editor}__upload--before--BorderColor: var(--#{$code-editor}__main--m-drag-hover--before--BorderColor); |
| 194 |
} |
| 195 |
|
| 196 |
// stylelint-disable selector-class-pattern |
| 197 |
.monaco-editor { |
| 198 |
background-color: var(--#{$code-editor}__main--BackgroundColor); |
| 199 |
} |
| 200 |
|
| 201 |
a.label-name { text-decoration-line: none; } // revert normalize.scss |
| 202 |
// stylelint-enable selector-class-pattern |
| 203 |
} |
| 204 |
|
| 205 |
.#{$code-editor}__header + .#{$code-editor}__main { |
| 206 |
border-block-start-width: 0; |
| 207 |
} |
| 208 |
|
| 209 |
.#{$code-editor}__code { |
| 210 |
position: relative; |
| 211 |
height: 100%; |
| 212 |
padding-block-start: var(--#{$code-editor}__code--PaddingBlockStart); |
| 213 |
padding-block-end: var(--#{$code-editor}__code--PaddingBlockEnd); |
| 214 |
padding-inline-start: var(--#{$code-editor}__code--PaddingInlineStart); |
| 215 |
padding-inline-end: var(--#{$code-editor}__code--PaddingInlineEnd); |
| 216 |
|
| 217 |
.#{$code-editor}__code-pre { |
| 218 |
font-family: var(--#{$code-editor}__code-pre--FontFamily); |
| 219 |
font-size: var(--#{$code-editor}__code-pre--FontSize); |
| 220 |
white-space: pre-wrap; |
| 221 |
} |
| 222 |
} |
| 223 |
|
| 224 |
.#{$code-editor}__tab { |
| 225 |
position: relative; |
| 226 |
display: flex; |
| 227 |
align-items: center; |
| 228 |
padding-block-start: var(--#{$code-editor}__tab--PaddingBlockStart); |
| 229 |
padding-block-end: var(--#{$code-editor}__tab--PaddingBlockEnd); |
| 230 |
padding-inline-start: var(--#{$code-editor}__tab--PaddingInlineStart); |
| 231 |
padding-inline-end: var(--#{$code-editor}__tab--PaddingInlineEnd); |
| 232 |
margin-inline-start: auto; |
| 233 |
color: var(--#{$code-editor}__tab--Color); |
| 234 |
background-color: var(--#{$code-editor}__tab--BackgroundColor); |
| 235 |
border-color: var(--#{$code-editor}__tab--BorderColor); |
| 236 |
border-style: solid; |
| 237 |
border-block-start-width: var(--#{$code-editor}__tab--BorderBlockStartWidth); |
| 238 |
border-block-end-width: var(--#{$code-editor}__tab--BorderBlockEndWidth); |
| 239 |
border-inline-start-width: var(--#{$code-editor}__tab--BorderInlineStartWidth); |
| 240 |
border-inline-end-width: var(--#{$code-editor}__tab--BorderInlineEndWidth); |
| 241 |
border-start-end-radius: var(--#{$code-editor}__tab--BorderStartEndRadius); |
| 242 |
} |
| 243 |
|
| 244 |
.#{$code-editor}__tab-icon + .#{$code-editor}__tab-text { |
| 245 |
margin-inline-start: var(--#{$code-editor}__tab-icon--text--MarginInlineStart); |
| 246 |
} |