Refactor Claro's button stylesheet

Created on 3 July 2022, over 2 years ago
Updated 25 September 2023, about 1 year ago

Problem/Motivation

This is part of the CSS modernization initiative. This is intended to be a straightforward second issue.

The first issue was regarding the button stylesheet .

Steps to reproduce

The stylesheet at https://git.drupalcode.org/project/drupal/-/blob/10.0.x/core/themes/claro/css/components/button.pcss.css needs to be refactored to make use of modern CSS and Drupal core's PostCSS tooling.

Proposed resolution

Use CSS Logical Properties where appropriate
Use CSS nesting where appropriate

Remaining tasks

User interface changes

None. There should be no visual differences.

Testing HTML

<h2>Regular</h2>
<button class="button">Lorem, ipsum dolor.</button><br>
<a href="#" class="button">Lorem, ipsum dolor.</a><br>
<input type="submit" class="button" value="Lorem ipsum dolor"><br>

<h2>Small</h2>
<button class="button button--small">Lorem, ipsum dolor.</button><br>
<a href="#" class="button button--small">Lorem, ipsum dolor.</a><br>
<input type="submit" class="button button--small" value="Lorem ipsum dolor"><br>

<h2>Extra Small</h2>
<button class="button button--extrasmall">Lorem, ipsum dolor.</button><br>
<a href="#" class="button button--extrasmall">Lorem, ipsum dolor.</a><br>
<input type="submit" class="button button--extrasmall" value="Lorem ipsum dolor"><br>

<h2>Action</h2>
<button class="button button--action">Lorem, ipsum dolor.</button><br>
<a href="#" class="button button--action">Lorem, ipsum dolor.</a><br>
<input type="submit" class="button button--action" value="Lorem ipsum dolor"><br>

<h2>primary</h2>
<button class="button button--primary">Lorem, ipsum dolor.</button><br>
<a href="#" class="button button--primary">Lorem, ipsum dolor.</a><br>
<input type="submit" class="button button--primary" value="Lorem, ipsum dolor."><br>

<h2>danger</h2>
<button class="button button--danger">Lorem, ipsum dolor.</button><br>
<a href="#" class="button button--danger">Lorem, ipsum dolor.</a><br>
<input type="submit" class="button button--danger" value="Lorem, ipsum dolor."><br>

<h2>Disabled</h2>
<button disabled class="button">Lorem, ipsum dolor.</button><br>
<button class="button is-disabled">Lorem, ipsum dolor.</button><br>
<a href="#" class="button is-disabled">Lorem, ipsum dolor.</a><br>
<input type="submit" disabled class="button" value="Lorem ipsum dolor"><br>
<input type="submit" class="button is-disabled" value="Lorem ipsum dolor"><br>

<h2>Link</h2>
<button class="link">Lorem, ipsum dolor.</button><br>
<input type="submit" class="link" value="Lorem ipsum dolor"><br>

📌 Task
Status

Fixed

Version

11.0 🔥

Component
Claro 

Last updated 2 days ago

Created by

🇸🇮Slovenia sasanikolic

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

    It involves the content or handling of Cascading Style Sheets.

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.71.5 2024