[meta] Add in js- prefixed classes for separation of JS & CSS functionality

Created on 23 February 2015, over 9 years ago
Updated 24 January 2024, 5 months ago

Problem/Motivation

We expose many class attributes in templates and other layers (for example preprocess), but it's never clear which classes are needed for JavaScript functionality, leaving themers in the dark if they want to slim down their markup and not break JS.

Proposed resolution

Add CSS classes for JavaScript functionality. Classes will use the original name and be prefixed with .js- and be added to the existing class (in Classy) for separating design and functionality.

Classy

<div class="foo"> -> <div class ="js-foo foo">

Core

<div class="foo"> -> <div class ="js-foo">

This is a step along the way to using data attributes, but even if we don't get to data attributes it's still an improvement.

Remaining tasks

See child issues.

User interface changes

None for themes extending Classy. Possible visual changes to themes not extending Classy.

API changes

n/a

Beta phase evaluation

<!--Uncomment the relevant rows for the issue. -->
πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component
JavascriptΒ  β†’

Last updated about 8 hours ago

Created by

πŸ‡©πŸ‡°Denmark mortendk

Live updates comments and jobs are added and updated live.
  • CSS

    It involves the content or handling of Cascading Style Sheets.

  • Needs change record

    A change record needs to be drafted before an issue is committed. Note: Change records used to be called change notifications.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024