Halloween Sale 15% off Ends in See the plans
SCSS

Event Details and Upcoming Events Styles (SCSS)

Lays out the [event_details] facts as a neat two-column list and the [upcoming_events] list with bold dates, collapsing to one column on phones.

Don’t have WPIDE yet? Install it on your site

Code

$label-width: 7rem;
$divider: color-mix(in srgb, currentColor 12%, transparent);

.event-details {
    display: grid;
    grid-template-columns: $label-width 1fr;
    gap: 0.5rem 1rem;
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border: 1px solid $divider;
    border-radius: 8px;

    dt {
        font-weight: 600;
    }

    dd {
        margin: 0;
    }

    @media (max-width: 480px) {
        grid-template-columns: 1fr;

        dd {
            margin-bottom: 0.5rem;
        }
    }
}

.upcoming-events {
    list-style: none;
    padding: 0;

    li {
        padding: 0.6rem 0;
        border-bottom: 1px solid $divider;
    }

    time {
        font-weight: 600;
    }
}

Notes

Pairs with the Event Details meta box and Upcoming Events shortcode snippets.

How to add this snippet

  1. Install WPIDE on your WordPress site (it is free) and open Code Snippets.
  2. Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
  3. It is added inactive: review the code and settings, then switch it on.

Have a snippet worth sharing?

Publish it to the library from WPIDE or right here. Sign in with any WordPress site that runs WPIDE, free or Pro. Public snippets are reviewed by the WPIDE team before they appear.

Which site should get this snippet?

Enter the address of your WordPress site. WPIDE opens there in a new tab with the snippet ready to review and save.

Remembered in this browser only, so you are asked once.

Report this snippet

Tell the WPIDE team what is wrong: broken code, something harmful, spam or copied work.