chromium/chrome/browser/resources/new_tab_page/lens_upload_dialog.css

/* Copyright 2024 The Chromium Authors
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file. */

/* #css_wrapper_metadata_start
 * #type=style-lit
 * #import=chrome://resources/cr_elements/cr_icons_lit.css.js
 * #scheme=relative
 * #include=cr-icons-lit
 * #css_wrapper_metadata_end */

:host {
  --upload-dialog-background: var(--color-new-tab-page-background-override);
  --upload-dialog-divider-line-border-top: 1px solid var(--google-grey-200);
  --upload-dialog-divider-line-or-label-color: var(--color-new-tab-page-secondary-foreground);
  --upload-dialog-drag-drop-background: var(--google-grey-50);
  --upload-dialog-drag-drop-border: 1px dashed var(--google-grey-400);
  --upload-dialog-drag-drop-error-background-color: var(--google-red-50);
  --upload-dialog-drag-drop-title-color: var(--color-new-tab-page-secondary-foreground);
  --upload-dialog-drag-drop-upload-text-color: var(--google-blue-700);
  --upload-dialog-error-message-color: var(--google-red-800);
  --upload-dialog-input-box-background: var(--color-new-tab-page-background-override);
  --upload-dialog-input-box-border-color: var(--google-grey-300);
  --upload-dialog-input-box-color: var(--google-grey-800);
  --upload-dialog-input-box-placeholder-color: var(--google-grey-700);
  --upload-dialog-input-submit-background: var(--color-new-tab-page-background-override);
  --upload-dialog-input-submit-border-color: var(--google-grey-300);
  --upload-dialog-input-submit-color: var(--google-blue-600);
  --upload-dialog-shadow: var(--cr-elevation-3);
  --upload-dialog-title-color: var(--google-grey-800);
  font-family: inherit;
  width: 100%;
}

:host([is-dragging_]),
:host([is-loading_]) {
  --upload-dialog-drag-drop-background: var(--google-blue-50);
}

@media (prefers-color-scheme: dark) {
  :host {
    --paper-spinner-color: var(--google-blue-300);
    --upload-dialog-background: var(--google-grey-850);
    --upload-dialog-divider-line-border-top: 1px solid var(--google-grey-800);
    --upload-dialog-drag-drop-background: rgba(var(--google-grey-900-rgb), .68);
    --upload-dialog-drag-drop-border: 1px dashed var(--google-grey-800);
    --upload-dialog-drag-drop-error-background-color: var(--google-red-300);
    --upload-dialog-drag-drop-upload-text-color: var(--google-blue-300);
    --upload-dialog-error-message-color: var(--google-grey-900);
    --upload-dialog-input-box-background: transparent;
    --upload-dialog-input-box-border-color: var(--google-grey-800);
    --upload-dialog-input-box-color: var(--google-grey-100);
    --upload-dialog-input-box-placeholder-color: var(--google-grey-300);
    --upload-dialog-input-submit-background: transparent;
    --upload-dialog-input-submit-border-color: var(--google-grey-800);
    --upload-dialog-input-submit-color: var(--google-blue-300);
    --upload-dialog-title-color: var(--google-grey-100);
  }

  :host([is-dragging_]),
  :host([is-loading_]) {
    --upload-dialog-drag-drop-background: rgba(var(--google-blue-300-rgb), .24);
    --upload-dialog-drag-drop-border: 1px dashed var(--google-blue-300);
    --upload-dialog-drag-drop-title-color: var(--google-blue-300);
  }
}

#dialog {
  background: var(--upload-dialog-background);
  border-radius: 22px;
  box-shadow: var(--upload-dialog-shadow);
  box-sizing: border-box;
  left: unset;
  padding: 20px;
  position: relative;
  right: unset;
}

:host-context([dir='rtl']) #closeButton {
  left: 20px;
  right: initial;
}

#closeButton {
  --cr-icon-button-fill-color:
      var(--color-new-tab-page-overlay-secondary-foreground);
  align-self: flex-end;
  cursor: pointer;
  display: flex;
  position: absolute;
  right: 20px;
  top: 15px;
}

#title {
  color: var(--upload-dialog-title-color);
  font-size: 16px;
  letter-spacing: 0.1px;
  line-height: 28px;
  margin-bottom: 14px;
  text-align: center;
}

#dragDropArea {
  background: var(--upload-dialog-drag-drop-background);
  border: var(--upload-dialog-drag-drop-border);
  border-radius: 8px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  height: 280px;
  padding: 20px;
  position: relative;
  width: 100%;
}

#dragDropError {
  align-items: center;
  background-color: var(--upload-dialog-drag-drop-error-background-color);
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  justify-content: space-between;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

#dragDropErrorMessage {
  color: var(--upload-dialog-error-message-color);
  flex: 1;
  font-size: 12px;
  padding: 5px;
  text-align: center;
}

.drag-drop-title-container {
  align-items: center;
  display: inline-flex;
  flex-direction: row;
  flex-grow: 1;
  justify-content: center;
}

#dragDropIllustration {
  background: url(icons/drag_drop_illustration.svg) no-repeat center;
  display: inline-flex;
  height: 45px;
  margin-inline-end: 18px;
  vertical-align: middle;
  width: 59px;
}

.drag-drop-title {
  color: var(--upload-dialog-drag-drop-title-color);
  font-size: 16px;
  line-height: 25px;
  max-width: 300px;
}

#dragText {
  display: inline-block;
  margin-inline-end: 4px;
}

#uploadText {
  color: var(--upload-dialog-drag-drop-upload-text-color);
  cursor: pointer;
  display: inline-block;
  white-space: nowrap;
}

#uploadText:focus,
#uploadText:hover {
  text-decoration: underline;
}

@media (forced-colors: active) {
  #uploadText {
    color: LinkText;
  }
}

#urlUploadContainer {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
}

#sectionDivider {
  align-items: center;
  display: flex;
}

.divider-line {
  border-top: var(--upload-dialog-divider-line-border-top);
  flex-grow: 1;
  height: 0;
}

#orLabel {
  color: var(--upload-dialog-divider-line-or-label-color);
  cursor: default;
  flex-shrink: 0;
  font-size: 14px;
  margin-inline-end: 20px;
  margin-inline-start: 20px;
}

#inputContainer {
  display: flex;
  margin-top: 14px;
}

#inputBox {
  background: var(--upload-dialog-input-box-background);
  border: 1px solid var(--upload-dialog-input-box-border-color);
  border-radius: 36px;
  color: var(--upload-dialog-input-box-color);
  display: inline-flex;
  flex-grow: 1;
  font-size: 14px;
  height: 40px;
  outline: none;
  padding: 0 24px;
  width: 100%;
}

#inputBox::placeholder {
  color: var(--upload-dialog-input-box-placeholder-color);
}

#inputBox:hover {
  --upload-dialog-input-box-border-color: var(--google-grey-800);
}

#inputBox:focus {
  --upload-dialog-input-box-border-color: var(--google-blue-700);
}

#inputBox:active {
  --upload-dialog-input-box-border-color: var(--google-blue-700);
}

@media (prefers-color-scheme: dark) {
  #inputBox:hover {
    --upload-dialog-input-box-border-color: var(--google-grey-700);
  }

  #inputBox:focus {
    --upload-dialog-input-box-border-color: var(--google-blue-300);
  }

  #inputBox:active {
    --upload-dialog-input-box-border-color: var(--google-blue-300);
  }
}

#inputSubmit {
  align-items: center;
  background: var(--upload-dialog-input-submit-background);
  border: 1px solid var(--upload-dialog-input-submit-border-color);
  border-radius: 32px;
  color: var(--upload-dialog-input-submit-color);
  cursor: pointer;
  display: inline-flex;
  flex-shrink: 0;
  font-size: 14px;
  justify-content: center;
  letter-spacing: 0.25px;
  margin-inline-start: 8px;
  outline: 0;
  padding: 8px 24px;
}

#inputSubmit:hover {
  --upload-dialog-input-submit-background: rgba(var(--google-blue-700-rgb), 0.08);
  --upload-dialog-input-submit-border-color: var(--google-grey-300);
  --upload-dialog-input-submit-color: var(--google-blue-600);
}

#inputSubmit:focus {
  --upload-dialog-input-submit-background: rgba(var(--google-blue-700-rgb), 0.08);
  --upload-dialog-input-submit-border-color: var(--google-blue-700);
  --upload-dialog-input-submit-color: var(--google-blue-600);
}

#inputSubmit:active {
  --upload-dialog-input-submit-background: rgba(var(--google-blue-700-rgb), 0.14);
  --upload-dialog-input-submit-border-color: var(--google-grey-300);
  --upload-dialog-input-submit-color: var(--google-blue-600);
}

@media (prefers-color-scheme: dark) {
  #inputSubmit:hover {
    --upload-dialog-input-submit-background: rgba(var(--google-blue-300-rgb), 0.04);
    --upload-dialog-input-submit-border-color: var(--google-grey-800);
    --upload-dialog-input-submit-color: var(--google-blue-100);
  }

  #inputSubmit:focus {
    --upload-dialog-input-submit-background: rgba(var(--google-blue-300-rgb), 0.12);
    --upload-dialog-input-submit-border-color: var(--google-blue-100);
    --upload-dialog-input-submit-color: var(--google-blue-100);
  }

  #inputSubmit:active {
    --upload-dialog-input-submit-background: rgba(var(--google-blue-300-rgb), 0.10);
    --upload-dialog-input-submit-border-color: var(--google-grey-800);
    --upload-dialog-input-submit-color: var(--google-blue-100);
  }
}

#loadingContainer,
#offlineContainer {
  align-items: center;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: center;
}

#loadingSpinner {
  display: block;
  margin-bottom: 12px;
}

#offlineTitle {
  color: var(--upload-dialog-title-color);
  text-align: center;
}

#offlineImage {
  background: url(icons/offline_dialog.svg) no-repeat center;
  height: 51px;
  margin-bottom: 24px;
  width: 55px;
}

#offlineSubtitle {
  color: var(--upload-dialog-drag-drop-title-color);
  font-size: 16px;
  margin-top: 6px;
}

#offlineRetryButton {
  margin-top: 21px;
}