Views table column align options don't take into account RTL langaguages - remove?

Created on 24 March 2025, 4 months ago

Problem/Motivation

Views tables have a setting for column text alignment. This currently relies on CSS shipped with Views module, although πŸ“Œ Remove the views-align-* CSS classes Active will refactor it to use core's align.module.css classes which are otherwise identical.

There is no RTL support.

I think that either this should be using start/end - which requires updating the core library after πŸ“Œ Remove the views-align-* CSS classes Active or just the entire option should just be removed. If someone wants to theme a specific table they can do that with their own CSS. No core themes use it, and I don't remember ever using it on a project either.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component

views.module

Created by

πŸ‡¬πŸ‡§United Kingdom catch

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

Merge Requests

Comments & Activities

  • Issue created by @catch
  • πŸ‡¬πŸ‡§United Kingdom catch

    Moving this under CSS.

    This appears to be mainly supported by the 'align' core filter, which could use #attached.

    So I wonder whether the align filter, and views once it's using the core classes, could both #attach a core/align library.

    Then we'd still need to address the lack of RTL support on top of that too.

  • πŸ‡¬πŸ‡§United Kingdom d.fisher

    darren.fisher β†’ made their first commit to this issue’s fork.

  • πŸ‡¬πŸ‡§United Kingdom d.fisher

    I've updated the CSS in align.module.css to use modern logical properties. Ideally the class names would also change but that will introduce breaking changes for any themes that use the existing classes. Let me know if there's anything else that needs to happen on this?

  • Pipeline finished with Success
    4 months ago
    Total: 651s
    #457839
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Should this be postponed on πŸ“Œ Remove the views-align-* CSS classes Active

  • πŸ‡¬πŸ‡§United Kingdom catch

    @smustgrave they can happen independently, the other issue doesn't change the CSS file here at all, just remove's views' own version.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Ok in that case should this land now? Know there was a comment in the other about combining.

    Applied the MR though and text-align right still appears to be working as before so marking RTBC if this should still land before.

  • πŸ‡¬πŸ‡§United Kingdom catch

    Not sure what to do about the classnames though, will at least need another follow-up so back to review for that.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Not sure I follow

  • Status changed to Needs review about 1 month ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Sorry let this one lapse but still not sure how to best test

  • πŸ‡¬πŸ‡§United Kingdom catch

    There is an align text filter with core, so it would need a text format that uses that filter, that then uses the align options, to see if the existing classes actually do anything. I haven't tried this, it's the only place I could find that possibly uses the functionality.

    Once that's confirmed, could then switch to the MR branch to see if it works with the logical properties.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Here's the screenshot before the MR

    After applying the MR and clearing cache I get the same exact results.

    To me then this is good to go right.

  • πŸ‡¬πŸ‡§United Kingdom longwave UK

    I'm not sure we should commit at least the text-align-* part, as I think this change affects RTL users who might have formatted text in CKEditor. The CKEditor alignment plugin uses these classes:

    ckeditor5_alignment:
      ckeditor5:
        plugins: [alignment.Alignment]
        config:
          # @see core/modules/system/css/components/align.module.css
          alignment:
            options:
              - name: left
                className: text-align-left
              - name: center
                className: text-align-center
              - name: right
                className: text-align-right
              - name: justify
                className: text-align-justify
    

    If users in an RTL language have used these to explicitly force text to one of the screen, after this is committed, won't the text move to the other side? It also means the icons are backwards for RTL users now; the icons that shows left-aligned text will right align it for them.

Production build 0.71.5 2024