Files
threshold-ui/ui/desktop/app/styles/app.scss
T

519 lines
9.6 KiB
SCSS
Raw Normal View History

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
2020-11-12 15:13:28 -05:00
@use 'rose/variables/sizing';
@use 'rose/variables/media';
@use 'rose/utilities/type';
2020-11-12 15:13:28 -05:00
2020-11-05 17:22:23 -05:00
@import 'rose';
2020-11-12 15:13:28 -05:00
@import 'notify';
.rose-layout-centered {
> .rose-layout-page {
width: sizing.rems(l) * 18;
}
@media (max-width: media.width(small)) {
display: block;
> .rose-layout-page {
width: auto;
}
}
}
/**
* This section enables scrolling within the sidebar columns separately,
* rather than the whole viewport. This ensures the sidebar and application
* header remain visible when scrolling.
*/
.rose-layout-global {
max-height: 100vh;
.rose-layout-global-body {
max-height: 100vh;
overflow: auto;
main {
flex-grow: 1;
}
}
.rose-layout-sidebar-sidebar,
.rose-layout-sidebar-body {
overflow-y: auto;
}
}
2020-11-12 15:13:28 -05:00
.rose-nav-sidebar {
margin-top: sizing.rems(xxl);
+ .rose-nav-sidebar {
2020-11-12 15:13:28 -05:00
margin-top: 0;
}
.rose-icon {
margin-right: sizing.rems(xs);
}
}
.rose-form {
&:not(.full-width) {
width: 66%;
}
.rose-form-input {
width: 100%;
.rose-form-input-field {
width: 100%;
}
}
.rose-dropdown {
2020-11-13 12:11:12 -05:00
$icon-width: sizing.rems(m) + sizing.rems(s);
2020-11-16 15:08:59 -05:00
$indent: $icon-width + sizing.rems(xs);
2020-11-12 15:13:28 -05:00
.rose-form-radio-label {
display: flex;
.rose-icon {
padding-right: sizing.rems(xxs);
}
}
2021-12-15 09:43:20 -05:00
.rose-icon {
margin-right: sizing.rems(xxs);
margin-left: sizing.rems(xxs);
}
2020-11-12 15:13:28 -05:00
.indent-label-1 {
2021-12-15 09:43:20 -05:00
.rose-form-radio-label,
.rose-form-checkbox-label {
2020-11-12 15:13:28 -05:00
padding-left: $indent;
}
}
.indent-label-2 {
2021-12-15 09:43:20 -05:00
.rose-form-radio-label,
.rose-form-checkbox-label {
padding-left: $indent * 1.5;
2020-11-12 15:13:28 -05:00
}
}
.is-project {
.rose-icon {
visibility: hidden;
}
}
}
fieldset {
margin-bottom: sizing.rems(m);
legend {
@extend .rose-form-label;
}
}
}
.rose-table {
p {
margin-bottom: 0;
}
.rose-form-checkbox {
margin-bottom: 0;
.rose-form-checkbox-label-text {
color: var(--stark);
text-decoration: underline;
}
}
}
.rose-header {
-webkit-app-region: drag;
min-height: sizing.rems(l) * 2;
position: relative;
2021-06-06 11:29:23 -04:00
-webkit-user-select: none;
2020-11-23 18:10:11 -05:00
2021-06-06 11:29:23 -04:00
.rose-header-brand,
.rose-header-nav,
.rose-header-utilities .rose-dropdown,
.rose-header-utilities button {
-webkit-app-region: no-drag;
}
&.header-cushion {
padding-left: sizing.rems(l) * 3;
}
.button-window-minimize,
.button-window-fullscreen,
.button-window-close {
background: transparent;
border: transparent;
color: var(--white);
margin: sizing.rems(xs);
}
2020-11-12 15:13:28 -05:00
.logotype {
display: none;
}
.rose-dropdown {
.rose-icon {
transform: scale(0.7);
}
}
&.loading {
&::after {
animation: gradient 1s linear infinite;
2020-11-16 15:08:59 -05:00
background: repeating-linear-gradient(
to right,
var(--subtle),
var(--subtle),
var(--info),
var(--subtle),
var(--subtle)
);
2020-11-12 15:13:28 -05:00
background-position: -100% 0;
background-size: 200% auto;
content: ' ';
height: 3px;
left: 0;
position: absolute;
right: 0;
top: 100%;
@keyframes gradient {
2020-11-16 15:08:59 -05:00
0% {
background-position: -100% 0;
}
2020-11-16 15:08:59 -05:00
100% {
background-position: -200% 0;
}
2020-11-12 15:13:28 -05:00
}
}
}
}
.copyable {
white-space: nowrap;
.copyable-button {
margin: 0;
padding: 0 sizing.rems(xxs);
top: -2px;
}
mark {
animation: fadeBackground 0.75s linear;
background-color: transparent;
color: inherit;
@keyframes fadeBackground {
2020-11-16 15:08:59 -05:00
0% {
background-color: var(--action-subtler-1);
}
2020-11-16 15:08:59 -05:00
100% {
background-color: transparent;
}
2020-11-12 15:13:28 -05:00
}
}
}
[class*='session-status-'] {
color: var(--ui-gray-subtler-2);
}
.session-status-active {
color: var(--success);
}
.nowrap {
white-space: nowrap;
}
2020-11-24 13:11:15 -05:00
2020-11-25 12:32:47 -05:00
.branded-card {
border: 1px solid var(--ui-border-subtler-1);
border-radius: sizing.rems(xxxs);
margin: 0 auto;
margin-top: sizing.rems(l) * 1.25;
padding: (sizing.rems(l) * 4) (sizing.rems(l) * 3) (sizing.rems(l) * 2)
(sizing.rems(l) * 3);
position: relative;
width: sizing.rems(l) * 16;
2020-11-25 12:32:47 -05:00
&::before {
background-color: var(--black);
2020-11-25 16:42:28 -05:00
background-image: url('/brand-background.svg');
background-position: right;
background-repeat: no-repeat;
2020-11-25 12:32:47 -05:00
border-top-left-radius: sizing.rems(xxxs);
border-top-right-radius: sizing.rems(xxxs);
content: ' ';
height: sizing.rems(l) * 3.25;
left: 0;
position: absolute;
right: 0;
top: 0;
2020-11-25 12:32:47 -05:00
}
2020-11-25 16:42:28 -05:00
&::after {
background-image: url('/logo-app-full.svg');
background-position: (sizing.rems(l) * 2.5) 50%;
background-repeat: no-repeat;
background-size: sizing.rems(l) * 8;
content: ' ';
height: sizing.rems(l) * 3.25;
left: 0;
position: absolute;
right: 0;
top: 0;
2020-11-25 16:42:28 -05:00
}
2020-11-25 12:32:47 -05:00
.branded-card-title {
margin-bottom: 0;
}
.branded-card-description {
2020-11-25 15:18:17 -05:00
margin-bottom: sizing.rems(l);
2020-11-25 12:32:47 -05:00
}
.rose-form-actions {
.rose-button-primary {
display: block;
margin: 0;
width: 100%;
.rose-button-wrapper {
display: inline;
}
}
}
2020-11-24 13:11:15 -05:00
}
2020-11-25 16:42:28 -05:00
@media (max-width: media.width(medium)) {
.branded-card {
max-width: 100%;
width: auto;
2020-11-25 16:42:28 -05:00
}
}
.change-origin {
2021-06-11 15:00:31 -07:00
@include type.type(s);
color: var(--ui-border-starker-1);
margin: sizing.rems(l) 0 0 0;
text-align: center;
}
2021-05-31 09:18:54 -07:00
// Dialog Detail
// These styles are a Work In Progress. Expect changes (lots of them)
.rose-dialog,
2021-06-08 16:36:23 -04:00
.dialog-detail {
z-index: 6000;
}
.dialog-detail {
.rose-notification {
border-left: 0;
border-right: 0;
border-top: 0;
box-shadow: none;
margin-bottom: 0;
2021-05-31 09:18:54 -07:00
}
2021-06-08 16:36:23 -04:00
.rose-dialog-body {
> :first-child {
margin-top: 0;
padding-top: 0;
}
}
.rose-dialog-footer {
align-items: center;
div:nth-child(1) {
display: flex;
justify-content: flex-start;
width: 50%;
2021-05-31 09:18:54 -07:00
}
div:nth-child(2) {
2021-05-31 09:18:54 -07:00
display: flex;
justify-content: flex-end;
width: 50%;
2021-05-31 09:18:54 -07:00
}
}
2021-06-18 12:29:39 -07:00
}
// Overlay above everything - including notifications
.rose-dialog-modal-overlay {
z-index: 5500;
}
2021-06-18 12:29:39 -07:00
2021-06-22 16:43:02 -04:00
// Reveal component (app/components/reveal)
$chevron-up: url("data:image/svg+xml;utf-8,<svg viewBox='0 0 24 24' fill='%231563FF' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M7.41 16L12 11.42L16.59 16L18 14.59L12 8.59L6 14.59L7.41 16Z' /></svg>");
$chevron-down: url("data:image/svg+xml;utf-8,<svg viewBox='0 0 24 24' fill='%231563FF' xmlns='http://www.w3.org/2000/svg'><path fill-rule='evenodd' clip-rule='evenodd' d='M16.59 8.59L12 13.17L7.41 8.59L6 10L12 16L18 10L16.59 8.59Z' /></svg>");
2021-05-31 09:18:54 -07:00
2021-06-11 14:48:41 -07:00
.reveal {
2021-06-22 16:43:02 -04:00
--trigger-color: var(--action);
2021-05-31 09:18:54 -07:00
2021-06-22 16:43:02 -04:00
.reveal-trigger {
background: url($chevron-down) no-repeat right center;
color: var(--trigger-color);
cursor: default;
display: inline-block;
overflow: hidden;
padding-right: sizing.rems(l);
white-space: nowrap;
// Hide default twistie triangle
// Firefox
list-style-type: none;
2021-06-22 16:43:02 -04:00
// Webkit / Chromium
&::-webkit-details-marker {
display: none;
2021-06-18 12:29:39 -07:00
}
2021-06-22 16:43:02 -04:00
&::marker {
2021-06-18 12:29:39 -07:00
display: none;
}
2021-06-22 16:43:02 -04:00
&:hover {
--trigger-color: var(--action-starker-1);
2021-06-18 12:29:39 -07:00
}
2021-06-22 16:43:02 -04:00
}
2021-06-18 12:29:39 -07:00
2021-06-22 16:43:02 -04:00
&:not([open]) {
2021-06-23 13:48:51 -07:00
.reveal-trigger-text-close {
background: $chevron-down no-repeat right center;
padding-right: sizing.rems(l);
}
2021-06-22 16:43:02 -04:00
.reveal-trigger-text-open {
2021-06-18 12:29:39 -07:00
display: none;
}
}
2021-06-22 16:43:02 -04:00
&[open] {
2021-06-23 13:48:51 -07:00
.reveal-trigger-text-open {
background: $chevron-up no-repeat right center;
padding-right: sizing.rems(l);
2021-06-11 14:48:41 -07:00
}
2021-06-22 16:43:02 -04:00
.reveal-trigger-text-close {
2021-06-11 14:48:41 -07:00
display: none;
}
pre {
white-space: pre-wrap;
word-break: break-all;
}
2021-06-11 14:48:41 -07:00
}
}
2021-06-22 16:43:02 -04:00
// Card component (app/components/card)
.card {
border: sizing.rems(xxxxs) solid var(--ui-gray-subtler-3);
display: flex;
flex-direction: column;
margin-bottom: sizing.rems(m);
.card-header {
2021-06-18 16:23:07 -07:00
align-items: center;
border-bottom: sizing.rems(xxxxs) solid var(--ui-gray-subtler-3);
display: flex;
2021-06-23 11:37:28 -07:00
justify-content: space-between;
2021-06-24 10:59:11 -04:00
padding: sizing.rems(s) sizing.rems(s) sizing.rems(s) sizing.rems(m);
2021-06-16 13:42:57 -07:00
2021-06-18 16:23:07 -07:00
h2 {
@include type.type(s, normal);
2021-06-18 16:23:07 -07:00
color: var(--ui-gray-starker-1);
2021-06-22 12:08:31 -04:00
margin: 0;
padding: sizing.rems(xxs) + sizing.rems(xxxs) 0;
2021-06-18 16:23:07 -07:00
}
2021-06-22 12:08:31 -04:00
.rose-icon {
margin-right: sizing.rems(xxxs);
2021-06-16 13:42:57 -07:00
}
}
.card-body {
padding: sizing.rems(s);
}
.card-footer {
border-top: sizing.rems(xxxxs) solid var(--ui-gray-subtler-3);
padding: sizing.rems(s);
}
// Allow text wrapping for copyable content in table
.rose-table .copyable {
white-space: inherit;
word-break: break-word;
}
2021-05-31 09:18:54 -07:00
}
2021-06-24 12:06:25 -07:00
2021-06-24 13:54:42 -07:00
// Hidden secret component (app/components/hidden-secret)
.hidden-secret {
display: flex;
align-items: center;
2021-07-07 12:39:44 -07:00
2021-06-24 14:54:26 -07:00
.copyable {
display: flex;
width: 100%;
justify-content: space-between;
.copyable-content {
display: flex;
align-items: center;
pre {
white-space: pre-wrap;
line-height: normal;
}
}
.secret-mask {
color: var(--ui-gray-subtler-2);
}
.rose-button-ghost {
// Copyable button icon.
color: var(--ui-gray-subtler-1);
}
2021-06-24 14:54:26 -07:00
}
.rose-button-ghost {
// Hide/Show secret button icon.
color: var(--ui-gray);
2021-06-24 13:54:42 -07:00
}
}
// Spinning animation for refresh button icon
2022-05-05 08:28:41 -07:00
@media (prefers-reduced-motion: no-preference) {
.is-loading {
.rose-icon {
@keyframes hds-flight-icon-animation-rotation {
to {
transform: rotate(360deg);
}
2022-05-05 08:28:41 -07:00
}
2022-05-05 08:28:41 -07:00
> svg {
animation: hds-flight-icon-animation-rotation 0.7s linear infinite;
}
}
}
}