Jelajahi Sumber

Merge pull request #25113 from overleaf/td-remove-button-info-variant

Change labs/new editor buttons to be based on secondary buttons

GitOrigin-RevId: f02565e60be33ff75c217c1ea1d0f24b3b619ed4
Tim Down 1 tahun lalu
induk
melakukan
057f4b4bb5

+ 1 - 1
services/web/frontend/js/features/editor-navigation-toolbar/try-new-editor-button.tsx

@@ -17,7 +17,7 @@ const TryNewEditorButton = () => {
         onClick={onClick}
         onClick={onClick}
         size="sm"
         size="sm"
         leadingIcon={<MaterialIcon type="experiment" unfilled />}
         leadingIcon={<MaterialIcon type="experiment" unfilled />}
-        variant="info"
+        variant="secondary"
       >
       >
         {t('try_the_new_editor')}
         {t('try_the_new_editor')}
       </OLButton>
       </OLButton>

+ 1 - 1
services/web/frontend/js/features/ide-redesign/components/toolbar/labs-actions.tsx

@@ -23,7 +23,7 @@ export const LabsActions = () => {
         >
         >
           <OLButton
           <OLButton
             size="sm"
             size="sm"
-            variant="info"
+            variant="secondary"
             className="ide-redesign-labs-button"
             className="ide-redesign-labs-button"
             onClick={openEditorRedesignSwitcherModal}
             onClick={openEditorRedesignSwitcherModal}
             leadingIcon={<MaterialIcon type="experiment" unfilled />}
             leadingIcon={<MaterialIcon type="experiment" unfilled />}

+ 2 - 2
services/web/frontend/js/features/pdf-preview/components/pdf-preview-error.tsx

@@ -23,7 +23,7 @@ function PdfPreviewError({ error }: { error: string }) {
                 components={[
                 components={[
                   // eslint-disable-next-line react/jsx-key
                   // eslint-disable-next-line react/jsx-key
                   <OLButton
                   <OLButton
-                    variant="info"
+                    variant="primary"
                     size="sm"
                     size="sm"
                     onClick={() => startCompile()}
                     onClick={() => startCompile()}
                   />,
                   />,
@@ -281,7 +281,7 @@ function TimedOutLogEntry() {
                 components={[
                 components={[
                   // eslint-disable-next-line react/jsx-key
                   // eslint-disable-next-line react/jsx-key
                   <OLButton
                   <OLButton
-                    variant="info"
+                    variant="primary"
                     size="sm"
                     size="sm"
                     onClick={handleEnableStopOnFirstErrorClick}
                     onClick={handleEnableStopOnFirstErrorClick}
                   />,
                   />,

+ 5 - 1
services/web/frontend/js/features/pdf-preview/components/stop-on-first-error-prompt.tsx

@@ -28,7 +28,11 @@ export default function StopOnFirstErrorPrompt() {
             // eslint-disable-next-line react/jsx-key
             // eslint-disable-next-line react/jsx-key
             components={[<strong />]}
             components={[<strong />]}
           />{' '}
           />{' '}
-          <OLButton variant="info" size="sm" onClick={handleDisableButtonClick}>
+          <OLButton
+            variant="primary"
+            size="sm"
+            onClick={handleDisableButtonClick}
+          >
             {t('disable_stop_on_first_error')}
             {t('disable_stop_on_first_error')}
           </OLButton>
           </OLButton>
         </>
         </>

+ 1 - 1
services/web/frontend/js/features/preview/components/preview-logs-pane-max-entries.jsx

@@ -41,7 +41,7 @@ function PreviewLogsPaneMaxEntries({ totalEntries, entriesShown, hasErrors }) {
                   i18nKey="log_entry_maximum_entries_enable_stop_on_first_error"
                   i18nKey="log_entry_maximum_entries_enable_stop_on_first_error"
                   components={[
                   components={[
                     <OLButton
                     <OLButton
-                      variant="info"
+                      variant="primary"
                       size="sm"
                       size="sm"
                       key="enable-stop-on-first-error"
                       key="enable-stop-on-first-error"
                       onClick={handleEnableStopOnFirstErrorClick}
                       onClick={handleEnableStopOnFirstErrorClick}

+ 0 - 1
services/web/frontend/js/features/ui/components/types/button-props.ts

@@ -34,5 +34,4 @@ export type ButtonProps = {
     | 'premium'
     | 'premium'
     | 'premium-secondary'
     | 'premium-secondary'
     | 'link'
     | 'link'
-    | 'info'
 }
 }

+ 11 - 0
services/web/frontend/stylesheets/bootstrap-5/abstracts/mixins.scss

@@ -60,6 +60,17 @@
   }
   }
 }
 }
 
 
+@mixin labs-button {
+  @include ol-button-variant(
+    $color: var(--content-positive),
+    $background: var(--bg-accent-03),
+    $border: var(--green-40),
+    $hover-background: var(--bg-accent-03),
+    $hover-border: var(--green-40),
+    $borderless: false
+  );
+}
+
 @mixin reset-button() {
 @mixin reset-button() {
   padding: 0;
   padding: 0;
   cursor: pointer;
   cursor: pointer;

+ 2 - 9
services/web/frontend/stylesheets/bootstrap-5/pages/editor/toolbar-redesign.scss

@@ -182,13 +182,6 @@
   }
   }
 }
 }
 
 
-.ide-redesign-labs-button.btn.btn-info {
-  @include ol-button-variant(
-    var(--content-positive),
-    var(--bg-accent-03),
-    var(--green-40),
-    var(--bg-accent-03),
-    var(--green-40),
-    false
-  );
+.ide-redesign-labs-button.btn.btn-secondary {
+  @include labs-button;
 }
 }

+ 4 - 9
services/web/frontend/stylesheets/bootstrap-5/pages/editor/toolbar.scss

@@ -533,15 +533,10 @@
   border-right: 1px solid var(--formatting-btn-border);
   border-right: 1px solid var(--formatting-btn-border);
 }
 }
 
 
-.toolbar-experiment-button.btn.btn-info {
-  @include ol-button-variant(
-    var(--content-positive),
-    var(--bg-accent-03),
-    var(--green-40),
-    var(--bg-accent-03),
-    var(--green-40),
-    false
-  );
+// Override a secondary button to ensure that the border is visible because
+// overriding a borderless button will not add a border.
+.toolbar-experiment-button.btn-secondary {
+  @include labs-button;
 
 
   max-height: 39px;
   max-height: 39px;
   font-size: var(--font-size-01);
   font-size: var(--font-size-01);