From: Stephen Cameron Date: Thu, 14 Nov 2019 17:19:38 +0000 (+0100) Subject: WIP #3053 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=7769a2040090d465711a4c6f6d44391548dd9a9d;p=ccv-wordpress.git WIP #3053 --- diff --git a/wp-content/mu-plugins/cube/src/Elementor/Setup.php b/wp-content/mu-plugins/cube/src/Elementor/Setup.php index b58a460..9a71741 100644 --- a/wp-content/mu-plugins/cube/src/Elementor/Setup.php +++ b/wp-content/mu-plugins/cube/src/Elementor/Setup.php @@ -21,7 +21,7 @@ class Setup { public function register_customisations() { $this->_customise_sections(); - $this->_customise_image_widget(); + $this->_customise_image_box_widget(); } @@ -160,26 +160,25 @@ class Setup { } - protected function _customise_image_widget() { + protected function _customise_image_box_widget() { - // Add controls to image widget in editor - add_action( 'elementor/element/image/section_image/before_section_end', function( $element, $args ) { + // Add controls to image box widget in editor + add_action( 'elementor/element/image-box/section_image/before_section_end', function( $element, $args ) { /** @var \Elementor\Element_Base $element */ $element->add_control( - 'link_icon', + 'content_alignment', [ - 'label' => __( 'Link Icon', 'cube' ), + 'label' => __( 'Vertical Alignment', 'cube' ), 'type' => Controls_Manager::SELECT, 'options' => [ - '' => __( 'None', 'cube' ), - 'tour-360' => __( '360 Tour', 'cube' ), - 'enlarge' => __( 'Enlarge', 'cube' ), + 'flex-start' => __( 'Top', 'cube' ), + 'center' => __( 'Center', 'cube' ), + 'flex-end' => __( 'Bottom', 'cube' ), ], - 'default' => '', - 'prefix_class' => 'icon-', - 'condition' => [ - 'link_to!' => 'none', + 'default' => 'center', + 'selectors' => [ + '{{WRAPPER}} .elementor-image-box-wrapper' => 'align-items: {{VALUE}};', ], ] ); diff --git a/wp-content/themes/CCV/resources/assets/styles/components/news.styl b/wp-content/themes/CCV/resources/assets/styles/components/news.styl index d190c76..f1b9654 100644 --- a/wp-content/themes/CCV/resources/assets/styles/components/news.styl +++ b/wp-content/themes/CCV/resources/assets/styles/components/news.styl @@ -1,8 +1,9 @@ .post &-featured-image - @apply bg-gray-300 bg-cover bg-center + @apply bg-cover bg-center @apply w-full + background-color: #ddd constrain(margin-right, 5vw) constrain(margin-bottom, 5vw) max-width: 336px diff --git a/wp-content/themes/CCV/resources/assets/styles/widgets/image-box.styl b/wp-content/themes/CCV/resources/assets/styles/widgets/image-box.styl index 436f850..6b19393 100644 --- a/wp-content/themes/CCV/resources/assets/styles/widgets/image-box.styl +++ b/wp-content/themes/CCV/resources/assets/styles/widgets/image-box.styl @@ -4,9 +4,12 @@ &-wrapper @apply text-left - &-img img +below(768px) - @apply mx-auto + @apply text-center + + &-img + display: flex + justify-content: center &-title @apply font-body text-lg mb-6 diff --git a/wp-content/themes/CCV/resources/assets/styles/widgets/text-block.styl b/wp-content/themes/CCV/resources/assets/styles/widgets/text-block.styl index de313fb..eb95eac 100644 --- a/wp-content/themes/CCV/resources/assets/styles/widgets/text-block.styl +++ b/wp-content/themes/CCV/resources/assets/styles/widgets/text-block.styl @@ -49,6 +49,9 @@ > * + * // Automatic spacing between direct child elements margin-top: 1.5em + h3 + p, h4 + p + margin-top: 0.5em + h3 @apply font-body font-medium text-lg diff --git a/wp-content/themes/CCV/tailwind.config.js b/wp-content/themes/CCV/tailwind.config.js index 360f92f..db1a845 100644 --- a/wp-content/themes/CCV/tailwind.config.js +++ b/wp-content/themes/CCV/tailwind.config.js @@ -3,6 +3,7 @@ const { wordpressUtilities } = require('tailwindcss-wordpress'); module.exports = { theme: { + screens: { // We're using the desktop-first approach to media queries so everything is max-width based // The most important breakpoint is when the columns stack. This is defined in setup.styl @@ -14,30 +15,35 @@ module.exports = { 'sm': {'max': '767px'}, // => @media (max-width: 767px) { ... } 'xs': {'max': '499px'}, // => @media (max-width: 499px) { ... } }, + + colors: { + 'inherit': 'inherit', + 'transparent': 'transparent', + 'white': '#FFF', + 'dark': '#1A0707', // Text colour + 'light': '#F6F5F5', // Light grey backgrounds + 'purple': '#5A5488', + 'purple-dark': '#2E2C40', // Footer and other dark sections + 'pink': '#FF078B', // Accent colour + 'pink-light': '#FF7EC3', // Hover colour + 'teal': '#2CC4CF', // Accent colour + 'teal-light': '#71D3DF', // Hover colour + }, + fontFamily: { + 'display': ['Dosis', 'sans-serif'], // Headings, labels, menus etc + 'body': ['Roboto Condensed', 'sans-serif'], // Main blocks of text + }, + fontSize: { + 'xs': '0.8181rem', // 18px + 'sm': '0.9091rem', // 20px + 'base': '1rem', // 22px + 'lg': '1.3636rem', // 30px + 'xl': '1.9091rem', // 42px + '2xl': '2.4545rem', // 54px + '3xl': '3.0909rem', // 68px + }, + extend: { - colors: { - 'inherit': 'inherit', - 'dark': '#1A0707', // Text colour - 'light': '#F6F5F5', // Light grey backgrounds - 'purple': '#5A5488', - 'purple-dark': '#2E2C40', // Footer and other dark sections - 'pink': '#FF078B', // Accent colour - 'pink-light': '#FF7EC3', // Hover colour - 'teal': '#2CC4CF', // Accent colour - 'teal-light': '#71D3DF', // Hover colour - }, - fontFamily: { - 'display': ['Dosis', 'sans-serif'], // Headings, labels, menus etc - 'body': ['Roboto Condensed', 'sans-serif'], // Main blocks of text - }, - fontSize: { - 'xs': '0.8181rem', // 18px - 'sm': '0.9091rem', // 20px - 'lg': '1.3636rem', // 30px - 'xl': '1.9091rem', // 42px - '2xl': '2.4545rem', // 54px - '3xl': '3.0909rem', // 68px - }, padding: { '0!': '0 !important', // Special overrides '100%': '100%', // Used for proportional padding to make a square @@ -47,11 +53,16 @@ module.exports = { } }, }, - variants: {}, + variants: { + + }, plugins: [ wordpressUtilities, ], corePlugins: { container: false, + float: false, + objectFit: false, + objectPosition: false, }, };