Page MenuHomePhabricator

[WtC-M3] [QB] Port Label mixin to Query Builder
Open, Needs TriagePublic

Description

Problem

The Label mixin was implemented to be reused by WiKit's field components, such as Input or Lookup. Some of the Wikibase-specific components that we need to port to the Query Builder also use Label. The assumption is that we should port this mixin as a dependency in order for said components to work.

Solution

In order to unblock the migration to Codex and the deprecation of WiKit, we'll port the WiKit Label mixin to the Query Builder repository. We'll apply all necessary changes to make the element compatible with the new version of the tool.

Considerations
  • Styles: In order to unblock WiKit's deprecation, we should also replace all WiKit tokens used currently to style the Label. We could use both discrete values or Codex tokens. It might be a slightly better idea to do the later in order to ensure consistency.

image.png (960×1 px, 71 KB)

Only creating design specs sounded like a limited and error-prone way to proceed with handover in this case. While replacing tokens directly seems more effective:

@mixin Label($displayType: "inline") {
  color: $color-base;
  font-family: $font-family-system-sans;
  font-size: $font-size-medium;
  font-weight: $font-weight-bold;
  line-height: $line-height-xx-small;
  display: $displayType;
  overflow-wrap: break-word;
  hyphens: auto;

  &--disabled {
    color: $color-disabled;
  }

  @if $displayType == block {
    padding-block-end: $spacing-25;
  }
}
Acceptance criteria
  • The WiKit Label is added to Query builder for its reusage by other ported Wikibase-specific components
  • Any WiKit building blocks, dependencies or styles are replaced

Details

Related Changes in Gerrit:

Event Timeline

Sarai-WMDE renamed this task from Port Label mixin to Query Builder to [SW] Port Label mixin to Query Builder.Jul 11 2024, 3:23 PM
Sarai-WMDE renamed this task from [SW] Port Label mixin to Query Builder to [SW] [WtC-M3] [QB] Port Label mixin to Query Builder.Jul 16 2024, 11:18 AM
Arian_Bozorg renamed this task from [SW] [WtC-M3] [QB] Port Label mixin to Query Builder to [WtC-M3] [QB] Port Label mixin to Query Builder.Jul 22 2024, 9:16 AM

Change #1082439 had a related patch set uploaded (by Hasan Akgün (WMDE); author: Hasan Akgün (WMDE)):

[wikidata/query-builder@master] Add wikit label mixin

https://gerrit.wikimedia.org/r/1082439

Change #1082439 merged by jenkins-bot:

[wikidata/query-builder@master] Add wikit label mixin

https://gerrit.wikimedia.org/r/1082439