Confusing width breaking container on mobile

Created on 5 July 2024, 5 months ago
Updated 25 August 2024, 3 months ago

I'm on Drupal 10.3.1 and Splide 2.0.9, and I can not seem to nail down why the splide slider on the homepage is breaking the container width.

I've tried adding "max-width: 100%" to the main splide, track, list, etc., but haven't had any success. The next thing I could do is try and calculate a calc(100vw - whatever my container padding is), but I feel there should be a better way where the slider picks up the parent width as it had for this same slider in previous versions.

💬 Support request
Status

Fixed

Version

2.0

Component

Code

Created by

🇺🇸United States w01f

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @w01f
  • 🇮🇩Indonesia gausarts

    Thank you.

    For any display issues with any frontend modules, the only way to judge/ debug better is to switch to core themes. However specific for D10, since Olivero is too advanced in CSS which may in turn pose advanced problems for mere mortal, the simplest core theme like Bartik, now contrib, is your best bet.

    Try switching to Bartik, and let me know?

    If persists, it might be a bug, and so more details are required.
    If Bartik says good, it must be your theme.

    Then, 3 possibilities I can think of for now:

    Try checking the ancestor CSS rules of your problem element one at a time by pressing F12.

  • 🇺🇸United States w01f

    That fixed it! It was the first one.

    In Drupal 10.3, the Olivero theme applies 'display: grid' by default to both .view and .view-content - so to counter this you have to apply 'display: block' to the views you don't want to use grid.

    For this case, I applied the following, targeting the specific view's name to override.

    .view-seasonal, .view-seasonal .view-content {
        display: block;
    }

    This will be an issue for anyone using Splide in 10.3 on with Olivero as the base front-end theme. Perhaps it would be best to add in the 'display: block' by default to views set to use the Splide display.

    • gausarts committed f2714093 on 2.0.x
      Issue #3459163 by W01F: Confusing width breaking container on mobile
      
  • Status changed to Fixed 3 months ago
  • 🇮🇩Indonesia gausarts

    This should do. If still an issue, just add more specificity like #3.

    Thank you.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024