Просмотр исходного кода

Merge pull request #19254 from overleaf/jel-cms-button-spacing

[web] Standardize button spacing in CMS pages using new site design

GitOrigin-RevId: da5756adc3074603584a4c7e80b9443602413711
Jessica Lawshe 2 лет назад
Родитель
Сommit
1430dbc690

+ 1 - 0
services/web/config/settings.defaults.js

@@ -822,6 +822,7 @@ module.exports = {
           h4: ['class', 'id'],
           h5: ['class', 'id'],
           h6: ['class', 'id'],
+          p: ['class'],
           col: ['width'],
           figure: ['class', 'id', 'style'],
           figcaption: ['class', 'id', 'style'],

+ 31 - 14
services/web/frontend/stories/style-guide.stories.jsx

@@ -353,20 +353,37 @@ export const ProgressBars = () => {
 
 export const Cards = () => {
   return (
-    <div className="content content-alt">
-      <Grid>
-        <Row>
-          <Col md={8} mdOffset={2}>
-            <div className="card">
-              <p>
-                Cards look best on a <code>.content.content-alt</code>{' '}
-                background
-              </p>
-            </div>
-          </Col>
-        </Row>
-      </Grid>
-    </div>
+    <>
+      <div className="content content-alt">
+        <Grid>
+          <Row>
+            <Col md={8} mdOffset={2}>
+              <div className="card">
+                <p>
+                  Cards look best on a <code>.content.content-alt</code>{' '}
+                  background
+                </p>
+              </div>
+            </Col>
+          </Row>
+        </Grid>
+      </div>
+      <div className="content website-redesign">
+        <Grid>
+          <Row>
+            <Col md={8} mdOffset={2}>
+              <h2>New card styles</h2>
+              <div className="card card-premium-border">
+                <h2>Header 2</h2>
+                <h3>Header 3</h3>
+                <h3>Header 4</h3>
+                <p>Dolor sit amet, consectetur adipiscing elit.</p>
+              </div>
+            </Col>
+          </Row>
+        </Grid>
+      </div>
+    </>
   )
 }
 

+ 21 - 1
services/web/frontend/stylesheets/app/cms-page.less

@@ -50,6 +50,25 @@
       }
     }
 
+    .p-no-text-nodes:has(.btn) {
+      margin-top: var(--spacing-09);
+
+      @media (max-width: @screen-xs-max) {
+        .btn {
+          width: 100%;
+          margin-left: 0;
+          margin-top: var(--spacing-05);
+        }
+        .btn:first-child {
+          margin-top: 0;
+        }
+      }
+    }
+
+    .btn + .btn {
+      margin-left: var(--spacing-06);
+    }
+
     blockquote.quote-picture-bottom {
       padding: (@line-height-computed / 2) @line-height-computed;
 
@@ -641,7 +660,8 @@
   flex-direction: column;
   * {
     &:last-child {
-      margin-top: auto;
+      flex: 1;
+      align-content: end;
     }
   }
 }

+ 19 - 0
services/web/frontend/stylesheets/components/card.less

@@ -120,4 +120,23 @@
     border-top: 8px solid var(--sapphire-blue);
     padding: 32px 40px 32px 40px;
   }
+
+  &.card-premium-border {
+    h2,
+    h3,
+    h4 {
+      color: var(--blue-60);
+    }
+    border-radius: 8px;
+    padding: var(--spacing-10);
+    border: 2px solid transparent;
+    background:
+      linear-gradient(white, white) padding-box,
+      linear-gradient(to right, var(--blue-40), #254c84, var(--blue-70))
+        border-box;
+
+    .btn {
+      width: 100%;
+    }
+  }
 }