]> _ Git - c6-wordpress.git/commitdiff
WIP #2684 @8.5
authorStephen Cameron <stephen@cubedesigners.com>
Thu, 9 May 2019 16:43:07 +0000 (18:43 +0200)
committerStephen Cameron <stephen@cubedesigners.com>
Thu, 9 May 2019 16:43:07 +0000 (18:43 +0200)
21 files changed:
wp-content/mu-plugins/cube/src/Elementor/Setup.php
wp-content/mu-plugins/cube/src/Elementor/Widgets/FeatureBlock.php [new file with mode: 0644]
wp-content/mu-plugins/cube/src/Elementor/Widgets/Heading.php
wp-content/mu-plugins/cube/src/Elementor/Widgets/HeroBlock.php
wp-content/mu-plugins/cube/src/Elementor/Widgets/TextBlock.php
wp-content/themes/c6/app/helpers.php
wp-content/themes/c6/resources/assets/styles/common/global.styl
wp-content/themes/c6/resources/assets/styles/common/mixins.styl
wp-content/themes/c6/resources/assets/styles/common/variables.styl
wp-content/themes/c6/resources/assets/styles/components/buttons.styl
wp-content/themes/c6/resources/assets/styles/components/forms.styl
wp-content/themes/c6/resources/assets/styles/components/headings.styl
wp-content/themes/c6/resources/assets/styles/components/text.styl
wp-content/themes/c6/resources/assets/styles/layouts/footer.styl
wp-content/themes/c6/resources/assets/styles/layouts/sections.styl
wp-content/themes/c6/resources/assets/styles/layouts/tinymce.styl
wp-content/themes/c6/resources/assets/styles/widgets/feature-block.styl [new file with mode: 0644]
wp-content/themes/c6/resources/assets/styles/widgets/heading.styl
wp-content/themes/c6/resources/assets/styles/widgets/hero-block.styl
wp-content/themes/c6/resources/assets/styles/widgets/text-block.styl
wp-content/themes/c6/resources/assets/styles/widgets/timeline.styl

index cbe32f5c05fe39f263c7bcf348403b1993f89760..6e3197c7cb41879dff6d2ee7e8245af6c1e794a7 100644 (file)
@@ -36,6 +36,7 @@ class Setup {
         $elementor->widgets_manager->register_widget_type( new Widgets\TextBlock() );
         $elementor->widgets_manager->register_widget_type( new Widgets\Heading() );
         $elementor->widgets_manager->register_widget_type( new Widgets\Timeline() );
+        $elementor->widgets_manager->register_widget_type( new Widgets\FeatureBlock() );
     }
 
     protected function _customise_sections() {
@@ -100,6 +101,17 @@ class Setup {
                 ]
             );
 
+            $element->add_control(
+                'stacking_margins',
+                [
+                    'label' => __('Disable margins when stacking columns?', 'cube'),
+                    'type' => Controls_Manager::SWITCHER,
+                    'default' => '',
+                    'return_value' => 'no-column-stacking-gap',
+                    'prefix_class' => '',
+                ]
+            );
+
         }, 10, 2 );
 
 
diff --git a/wp-content/mu-plugins/cube/src/Elementor/Widgets/FeatureBlock.php b/wp-content/mu-plugins/cube/src/Elementor/Widgets/FeatureBlock.php
new file mode 100644 (file)
index 0000000..e9afffc
--- /dev/null
@@ -0,0 +1,186 @@
+<?php
+
+namespace Cube\Elementor\Widgets;
+
+use Elementor\Widget_Base;
+use Elementor\Controls_Manager;
+use Elementor\Utils;
+
+
+/**
+ * Class Subtitle
+ * @package Cube\Elementor\Widgets
+ */
+class FeatureBlock extends Widget_Base
+{
+
+    // Widget name / ID
+    public function get_name() {
+        return 'cube-feature-block';
+    }
+
+    // Elementor widget title
+    public function get_title() {
+        return __('Feature Block', 'cube');
+    }
+
+    // Elementor interface icon
+    public function get_icon() {
+        return 'eicon-posts-grid';
+    }
+
+    // Where to display the widget in the Elementor interface
+    public function get_categories() {
+        return ['theme-elements'];
+    }
+
+    /**
+     * List of scripts the widget depends on.
+     * Used to set scripts dependencies required to run the widget.
+     *
+     * @since 1.0.0
+     * @access public
+     * @return array Widget scripts dependencies.
+     */
+    public function get_script_depends() {
+        return [];
+    }
+
+    /**
+     * Register the widget controls.
+     * Adds different input fields to allow the user to change and customize the widget settings.
+     *
+     * @since 1.0.0
+     * @access protected
+     */
+    protected function _register_controls() {
+
+        $this->start_controls_section(
+            'section_content',
+            [
+                'label' => __('Content', 'cube'),
+            ]
+        );
+
+        $this->add_control(
+            'image',
+            [
+                'label' => __( 'Image', 'elementor' ),
+                'type' => Controls_Manager::MEDIA,
+                'default' => [
+                    'url' => Utils::get_placeholder_image_src(),
+                ],
+            ]
+        );
+
+        $this->add_control(
+            'image_bottom_margin',
+            [
+                'label' => __( 'Image Margin (override)', 'cube' ),
+                'type' => Controls_Manager::TEXT,
+                'default' => '',
+                'selectors' => [
+                    '{{WRAPPER}} .feature-block-image' => 'margin-bottom: {{VALUE}};',
+                ],
+            ]
+        );
+
+        $this->add_control(
+            'title',
+            [
+                'label' => __('Title', 'elementor'),
+                'type' => Controls_Manager::TEXTAREA,
+                'placeholder' => __('Enter your title', 'elementor'),
+                'default' => '',
+            ]
+        );
+
+        $this->add_control(
+            'description',
+            [
+                'label' => __('Description', 'cube'),
+                'type' => Controls_Manager::TEXTAREA,
+                'default' => '',
+            ]
+        );
+
+        $this->add_control(
+            'bg_color',
+            [
+                'label' => __( 'Background Colour', 'cube' ),
+                'type' => Controls_Manager::COLOR,
+                'default' => '',
+                'selectors' => [
+                    '{{WRAPPER}} .feature-block-content' => 'background-color: {{VALUE}};',
+                ],
+            ]
+        );
+
+
+        $this->add_control(
+            'text_color',
+            [
+                'label' => __( 'Text Colour', 'cube' ),
+                'type' => Controls_Manager::COLOR,
+                'default' => '',
+                'selectors' => [
+                    '{{WRAPPER}} .feature-block' => 'color: {{VALUE}};',
+                ],
+            ]
+        );
+
+        $this->add_control(
+            'circle',
+            [
+                'label' => __('Circular Background', 'cube'),
+                'type' => Controls_Manager::SWITCHER,
+                'default' => '',
+                'return_value' => 'circle',
+                'prefix_class' => 'feature-block-'
+            ]
+        );
+
+        $this->end_controls_section();
+
+    }
+
+    /**
+     * Render the widget output on the frontend.
+     * Written in PHP and used to generate the final HTML.
+     *
+     * @since 1.0.0
+     * @access protected
+     */
+    protected function render() {
+
+        $image = $this->get_settings('image');
+        $title = $this->get_settings('title');
+        $description = $this->get_settings('description');
+
+        // CSS Classes for elements
+        $this->add_render_attribute('title', 'class', ['feature-block-title']);
+        $this->add_render_attribute('description', 'class', ['feature-block-description']);
+
+        // Rendered content
+        echo '<div class="feature-block">';
+        echo '<div class="feature-block-wrapper">';
+        echo '<div class="feature-block-content">';
+
+        if (!empty($image['id'])) {
+            echo wp_get_attachment_image($image['id'], 'medium', false, ['class' => 'feature-block-image']);
+        }
+
+        if (!empty($title)) {
+            echo "<h3 {$this->get_render_attribute_string('title')}>$title</h3>";
+        }
+
+        if (!empty($description)) {
+            echo "<div {$this->get_render_attribute_string('description')}>". nl2br($description) ."</div>";
+        }
+
+        echo '</div>'; // .feature-block-content
+        echo '</div>'; // .feature-block-wrapper
+        echo '</div>'; // .feature-block
+    }
+
+}
index e8b56339f335f1596254ed3d8f9c09236eac7ed4..1f67aa6c38307d37e34a51c5b2c1a97979b7db4e 100644 (file)
@@ -4,7 +4,6 @@ namespace Cube\Elementor\Widgets;
 
 use Elementor\Widget_Base;
 use Elementor\Controls_Manager;
-use Elementor\Scheme_Color;
 
 
 /**
index 2f55f8bd27d7505b2fa670a92defd2b1bdb27276..d70306bc9c8ee32c881151beaf224bc2b12c567f 100644 (file)
@@ -129,7 +129,7 @@ class HeroBlock extends Widget_Base {
             <div class="hero-block-content">
 
                 <div class="hero-block-content-inner">
-                    <h1 class="hero-block-title"><?= $title ?><div class="hero-block-body"><?= $body ?></div></h1>
+                    <h1 class="hero-block-title"><?= \App\prevent_orphans($title) ?><div class="hero-block-body"><?= $body ?></div></h1>
                 </div>
 
             </div>
index 6a5793e0d88fb1aa7636479526ae1b5411542374..1e9cc3880cbbeff1781151b76dc1deebaf1c4819 100644 (file)
@@ -4,7 +4,6 @@ namespace Cube\Elementor\Widgets;
 
 use Elementor\Widget_Base;
 use Elementor\Controls_Manager;
-use Elementor\Scheme_Color;
 
 
 class TextBlock extends Widget_Base {
@@ -56,16 +55,6 @@ class TextBlock extends Widget_Base {
             ]
         );
 
-
-        $this->add_control(
-                       'subtitle',
-                       [
-                               'label' => __( 'Subtitle', 'cube' ),
-                               'type' => Controls_Manager::TEXT,
-                               'default' => '',
-                       ]
-        );
-
         $this->add_control(
                        'title',
                        [
@@ -257,7 +246,6 @@ class TextBlock extends Widget_Base {
      */
     protected function render() {
 
-        $subtitle = $this->get_settings('subtitle');
         $title = $this->get_settings('title');
         $title_size = $this->get_settings('title_size');
         $body = $this->parse_text_editor($this->get_settings('body'));
@@ -277,13 +265,11 @@ class TextBlock extends Widget_Base {
         }
 
         // Inline Editing settings
-        $this->add_inline_editing_attributes('subtitle', 'none');
         $this->add_inline_editing_attributes('title', 'none');
         $this->add_inline_editing_attributes('body', 'advanced');
         $this->add_inline_editing_attributes('cta_text', 'none');
 
         // CSS Classes for elements
-        $this->add_render_attribute('subtitle', 'class', ['text-block-subtitle']);
         $this->add_render_attribute('title', 'class', ['text-block-title']);
         $this->add_render_attribute('body', 'class', ['text-block-body']);
         $this->add_render_attribute('cta_text', 'class', ['text-block-cta arrow-link']);
@@ -294,7 +280,6 @@ class TextBlock extends Widget_Base {
 
         // Rendered content
         echo '<div class="text-block">';
-        if (!empty($subtitle)) echo "<h3 {$this->get_render_attribute_string('subtitle')}>$subtitle</h3>";
         if (!empty($title)) echo "<h2 {$this->get_render_attribute_string('title')}>$title</h2>";
         if (!empty($body)) echo "<div {$this->get_render_attribute_string('body')}>$body</div>";
         if (!empty($cta_text)) {
@@ -314,7 +299,6 @@ class TextBlock extends Widget_Base {
        protected function _content_template() {
     ?>
                <#
-               view.addRenderAttribute( 'subtitle', 'class', ['text-block-subtitle']);
                view.addRenderAttribute( 'title', 'class', ['text-block-title']);
                view.addRenderAttribute( 'body', 'class', ['text-block-body']);
                view.addRenderAttribute( 'cta_text', 'class', ['text-block-cta arrow-link']);
@@ -323,17 +307,12 @@ class TextBlock extends Widget_Base {
             view.addRenderAttribute('title', 'class', ['text-block-title-size-' + settings.title_size]);
         }
 
-        view.addInlineEditingAttributes( 'subtitle', 'none' );
         view.addInlineEditingAttributes( 'title', 'none' );
                view.addInlineEditingAttributes( 'body', 'advanced' );
                view.addInlineEditingAttributes( 'cta_text', 'none' );
         #>
         <div class="text-block">
 
-            <# if ('' !== settings.subtitle) { #>
-                <h3 {{{ view.getRenderAttributeString( 'subtitle' ) }}}>{{{ settings.subtitle }}}</h3>
-            <# } #>
-
             <# if ('' !== settings.title) { #>
                 <h2 {{{ view.getRenderAttributeString( 'title' ) }}}>{{{ settings.title }}}</h2>
             <# } #>
index 2a6c284a76e185346cc32d527bcae7745730e133..c9eb00f4da2e5da2e62c289496ef2542dec98474 100644 (file)
@@ -136,3 +136,25 @@ function display_sidebar()
     isset($display) || $display = apply_filters('sage/display_sidebar', false);
     return $display;
 }
+
+
+/**
+ * Prevent a string from having orphans by replacing the
+ * last space between words with a non-breaking space
+ * @param string $text Text to be de-orphaned
+ * @return string
+ */
+function prevent_orphans($text)
+{
+    $search = ' '; // Search for spaces
+    $replace = '&nbsp;'; // Replace with non-breaking space
+
+    $text = trim($text); // Trim off any excess spaces at beginning and end
+    $pos = strrpos($text, ' '); // Find the last occurrence in the string
+
+    if($pos !== false) {
+        $text = substr_replace($text, $replace, $pos, strlen($search));
+    }
+
+    return $text;
+}
index a16945bbffa933379bba78e1cc9cae6ff8e1ca29..55f3249c8f36b456a3c8a032b40a37a35d4bd809 100644 (file)
@@ -1,7 +1,7 @@
 html
   box-sizing: border-box
   height: 100%
-  font-size: $font-size-base // This value won't be converted to REMs due to exception in font-size() mixin
+  font-size: $font-size.base // This value won't be converted to REMs due to exception in font-size() mixin
   +below(1250px)
     font-size: 15px
   +below(1024px)
index e01ccc28c3758fef60d8589147b38794ea02b89c..49271e356d8e3a5703d4114c5f0a706f68216e7a 100644 (file)
@@ -77,7 +77,7 @@ r(value)
   u = unit(value)
 
   if (u is 'px')
-    return unit(value / $font-size-base, 'rem')
+    return unit(value / $font-size.base, 'rem')
   else
     return value
 
index f40cf352805e8456419f0c350fe760fdd6748eca..c1b896e95205702e1fa9a134e45515fd9717fc2e 100644 (file)
@@ -9,25 +9,17 @@ $vertical-gutter   = 2.5vw
 // Fonts
 $font = 'Muli', sans-serif
 
-// TODO: replace any $font-size-xxx variable references with $font-size array below
 // Font sizing
-$font-size-base         = 16px // Size of 1rem
-
-$font-size-extra-large  = 81px // h1
-$font-size-large        = 54px // h2
-$font-size-medium       = 36px // h3
-$font-size-small        = 24px // h4
-$font-size-extra-small  = 12px //
-
+// See utilities.styl for font-size helper classes
+// (can't be done here because we need the mixins to be included first)
 $font-size = {
-  'sm': 12px,
-  'base': 16px,
-  'lg': 24px, // h4
-  'xl': 36px, // h3
-  '2xl': 54px, // h2
-  '3xl': 81px, // h1
+  small: 12px,
+  base: 16px, // Size of 1rem
+  medium: 24px, // h4
+  large: 36px, // h3
+  extra-large: 54px, // h2
+  huge: 81px, // h1
 }
-// See utilities.styl for font-size helpers (can't be done here because we need the mixins to be included first)
 
 // Breakpoints in Rupture (https://github.com/jescalan/rupture)
 rupture.scale        = 0 400px   768px   1024px
index 813b72d26a8930c2ecd12acbf0600e91fb75fa6b..0d21e7a078e3fa8be856874404f254b17b35d2cd 100644 (file)
@@ -19,7 +19,7 @@
   padding: 2em 5em
   text-align: center
   font-smoothing()
-  font-size: 12px
+  font-size: $font-size.small fixed // Don't use REMs
   font-weight: 800
   text-transform: uppercase
   transition: all 0.3s ease-out
index 3fc0be33c7d29e5b2920eb73399c65212ddef380..b73df31ccabae7f4c88d396a5339339650f363a8 100644 (file)
@@ -11,7 +11,7 @@ $border-color = $colors.text
   color: $placeholder-color
 
 input, textarea, select
-  font-size: $font-size-base
+  font-size: $font-size.base
   font-family: $font
   outline: none
   background-color: transparent
index f3a4c1718480536dcb219a5c4fa80039e123276f..0137253a5a3c9b472a1cb22f5e2b2d97d5fb4e95 100644 (file)
@@ -1,25 +1,31 @@
 h1, h2
   font-family: $font
-  font-size: $font-size-large
+  font-size: $font-size.extra-large
   line-height: 1.1
   margin-bottom: 0.4em
   font-weight: 500
 
-h3
+h3, h4
   line-height: 1.4
   font-weight: 500
 
+h3
+  font-size: $font-size.large
+
+h4
+  font-size: $font-size.medium
+
 
 .elementor-widget-heading
   .elementor-heading-title
     color: $colors.headings
     font-family: $font
-    font-size: $font-size-large
+    font-size: $font-size.extra-large
     white-space: pre-wrap
     line-height: 1.4
 
     +below('large')
-      font-size: $font-size-medium
+      font-size: $font-size.large
 
     //&:after
     //  content: ''
index d4d97719fad3b49a39301737e0bddfee4fdb3bb8..af91092a3c24f3265046e5cfe7c5ae413a58ff71 100644 (file)
@@ -1,11 +1,19 @@
 // Default styling for text blocks
-// Applied to .elementor-widget-container so Elemntor editor settings can override this setting
-.elementor-widget-text-editor .elementor-widget-container
-  horizontal-spacing(10vw)
-  padding-top: 40px
-  padding-bottom: 40px
-
-  //p
-  //  max-width: 400px
-  //  font-weight: 300
-  //  line-height: 1.8
+.elementor-widget-text-editor
+
+  // Applied to .elementor-widget-container so Elementor editor settings can override this setting
+  .elementor-widget-container
+    //horizontal-spacing(10vw)
+    //padding-top: 40px
+    //padding-bottom: 40px
+    center(960px)
+
+  // Extra bit of space when there's a heading + paragraph
+  h1 + p, h2 + p , h3 + p, h4 + p
+    margin-top: 0.5em
+
+  a
+    color: $colors.orange
+
+    &:hover
+      border-bottom: 1px dotted
index 31f728ce4ed7291b69730a6c09d6b3cb16fbdc6e..8083f143253802bc4614ccdbbe450bfe388041b7 100644 (file)
@@ -1,6 +1,6 @@
 $breakpoint-footer-cols-2 = 980px // When to break to 2 col view
 $breakpoint-footer-medium = 800px // Layout with logo + address on same line / other items stacked below
-$breakpoint-footer-cols-1 = 710px // When to break to 1 col view
+$breakpoint-footer-cols-1 = 500px // When to break to 1 col view
 
 .footer
 
index c316183d989633e455b0feb6b87dd9cb67a193b7..655bb39940b022a42c05ee74722b0fd6f3b00575 100644 (file)
@@ -1,18 +1,4 @@
-.elementor-section.elementor-section-full_width
-  //--- Columns responsiveness
-  // Full width sections have columns stacked but no margin is placed between them
-  // This is to accommodate the flexible background image blocks
-
-  // TODO: consider adding a "no gap" option to the section when wrapping? Then it can be applied to full width or boxed sections...
-
-
-  +below($breakpoint-columns)
-    .elementor-column
-      width: 100% !important
-
-
-.elementor-section.elementor-section-boxed
-
+.elementor-section
   //--- Columns responsiveness - stack all standard columns below breakpoint
   +below($breakpoint-columns)
     .elementor-column
@@ -20,8 +6,15 @@
       &:not(:last-of-type)
         margin-bottom: 7.5vw
 
+  // There's a toggle in the editor so we can disable
+  // this margin between columns when stacking vertically
+  &.no-column-stacking-gap
+    .elementor-column
+      +below($breakpoint-columns)
+        margin-bottom: 0
+
   //--- Default section layout
-  &.layout-default
+  &.layout-default.elementor-section-boxed
     > .elementor-container
       center($content-max-width * 0.8) // 1920px * 0.8 = 1536px
       horizontal-spacing(5vw)
index b266ba58a6bf496ea2954dfbc8fb5c3a38e0ae4b..67c6a16110ad9539b0c2b37708f0777688bb206c 100644 (file)
@@ -2,5 +2,5 @@ body#tinymce
   margin: 12px !important
 
   a
-    color: $colors.secondary
+    color: $colors.orange
     border-bottom: 1px dotted
diff --git a/wp-content/themes/c6/resources/assets/styles/widgets/feature-block.styl b/wp-content/themes/c6/resources/assets/styles/widgets/feature-block.styl
new file mode 100644 (file)
index 0000000..6c19284
--- /dev/null
@@ -0,0 +1,71 @@
+$breakpoint-circles = 1200px // Below this, circles aren't shown because content can't fit properly
+
+// Ensure full height on element so the content always covers the full area
+.elementor-widget-cube-feature-block,
+.elementor-widget-container,
+.feature-block,
+.feature-block-wrapper,
+.feature-block-content
+  height: 100%
+
+
+.feature-block
+
+  // When the content has a circle around it, we need to add
+  // padding to this outer div in order to give the circle some margin
+  .feature-block-circle &
+    +above($breakpoint-circles)
+      vertical-spacing(3vw)
+      horizontal-spacing(7.5vw)
+      display: flex
+      align-items: center
+      justify-content: center
+
+  &-wrapper
+
+    // Make the wrapper square so it will hold a perfect circle
+    // In this mode, content is taken out of the flow with absolute
+    // positioning, allowing proportional padding to be used to make
+    // a responsive square...
+    .feature-block-circle &
+      +above($breakpoint-circles)
+        flex: 1 1 auto
+        height: auto
+        padding-bottom: 100%
+        position: relative
+
+
+  &-content
+    constrain(padding, 7.5vw)
+    display: flex
+    flex-direction: column
+    align-items: center
+    justify-content: center
+    text-align: center
+    border-radius: 4px
+
+    // Make a circle within the square wrapper
+    .feature-block-circle &
+      +above($breakpoint-circles)
+        constrain(padding, 3vw) // Less padding due to circle
+        border-radius: 50%
+        position: absolute
+        top: 0
+        left: 0
+        width: 100%
+        height: 100%
+
+  &-image
+    margin-bottom: 2em
+
+  &-title
+    font-size: $font-size.medium
+    font-weight: 300
+    line-height: 1.2
+    white-space: pre-line
+
+  &-description
+    font-weight: 300
+    line-height: 1.8
+    margin-top: 0.5em
+
index 416503b3724bd4889d7eb3b816084c5c90e8037d..16155f35ca1fcb53518b8aafa39db3b0e4fdb053 100644 (file)
@@ -1,7 +1,11 @@
 .heading
   position: relative
   horizontal-spacing(7.5vw)
-  font-size: $font-size-extra-large // Size for title + used for positioning subtitle
+  //font-size: $font-size.huge // Size for title + used for positioning subtitle
+  constrain(font-size, 4.2vw)
+
+  +below(1200px)
+    font-size: $font-size.extra-large
 
   &-subtitle-wrapper
     position: absolute
@@ -21,7 +25,7 @@
     border-left: 2px solid
     padding-left: 0.25em
     text-transform: uppercase
-    font-size: 12px fixed
+    font-size: $font-size.small fixed
     color: $colors.orange
 
     +below(1000px)
index 264c9b412494055b960c27890f43538c21f87529..c9c3a09bd430f0f21ec835e22601f93d246ed3c5 100644 (file)
@@ -54,14 +54,14 @@ $breakpoint-hero = 1024px
 
 
   &-title
-    font-size: $font-size-extra-large
+    font-size: $font-size.huge
     font-weight: 700
     white-space: pre-line
     margin: 0
     line-height: 1
     text-align: center
 
-    +below(500px)
+    +below(720px)
       white-space: normal
       font-size: 60px
 
index cb0354eb4a7f3c5782885651fcf7eba9fde0ff5d..c51f333d1b82a464aadc7a70e040fda407edf13b 100644 (file)
 
 .text-block
 
-  &-subtitle
-    display: inline-block
-    font-size: $font-size-base
-    font-weight: 600
-    text-transform: uppercase
-    border: 2px solid
-    padding: 0.15em 0.5em
-    margin-bottom: 1em
-
   &-title
     font-smoothing()
     white-space: pre-line
-    font-size: $font-size-large
+    font-size: $font-size.extra-large
     font-weight: 300
 
     +below(1600px)
       white-space: normal // Avoid strange gaps caused by pre-line breaks wrapping
       font-size: 4.25vw // Using vw units so headings scale instead of wrapping further
     +below(795px) // Cap font size to medium once the vw size matches medium size
-      font-size: $font-size-medium // Note: also affected by the base HTML font size since it is converted rems
+      font-size: $font-size.large // Note: also affected by the base HTML font size since it is converted rems
     //+below(large)
-    //  font-size: $font-size-medium
+    //  font-size: $font-size.large
     //+below(medium)
     //  font-size: 35px
 
     &-size-medium
-      font-size: $font-size-medium
+      font-size: $font-size.large
 
     // No bottom margin if it's the last element (ie. no body below)
     &:last-child
     font-weight: 400
     margin-top: r(40px)
 
+    // If the body is the first child, there's no title
+    // so we don't want the top margin...
+    &:first-child
+      margin-top: 0
+
     h3
       font-size: 30px
       font-weight: 500
@@ -58,7 +54,7 @@
 
   &-cta
     font-smoothing()
-    font-size: 12px fixed // Won't be converted to rems
+    font-size: $font-size.small fixed // Won't be converted to rems
     font-weight: 800
     text-transform: uppercase
     display: inline-block
index dd58a77bd63a25f2115e6bb9275d3926bd8f7269..db03155a031cfe4976eb7e16d7bdf543a53e970a 100644 (file)
@@ -15,7 +15,7 @@
     display: block
     margin-bottom: 1.5em
     &.active
-      font-size: $font-size-small
+      font-size: $font-size.medium
       color: $colors.orange
 
 .timeline
@@ -28,7 +28,7 @@
     &-year
       margin-bottom: 0.8888em
     &-title
-      font-size: $font-size-medium
+      font-size: $font-size.large
       margin-bottom: 1.333em
     &-img
       margin-bottom: 48px
       p
         margin-bottom: 3em
       h4
-        font-size: $font-size-small
+        font-size: $font-size.medium
         font-weight: lighter
         margin-bottom: 1em
         margin-top: 2em
       h3
-        font-size: $font-size-medium
+        font-size: $font-size.large
         font-weight: lighter
         margin-bottom 1.33em
       ul
@@ -61,4 +61,4 @@
             left: -1.6em
             top: 12px
           &:last-of-type
-            margin-bottom: 0
\ No newline at end of file
+            margin-bottom: 0