Skip to:
Content

BuddyPress.org

Changeset 11905


Ignore:
Timestamp:
03/20/2018 12:34:32 PM (6 years ago)
Author:
djpaul
Message:

Templates, xprofile: fix markup a11y for date field type labels.

Correcting use of existing label elements -- and making them visible -- makes it obvious what the three date field elements represent (day, month, year) for all users.

Fixes #7665

Props Venutius, mercime, rianrietveld, hnla, djpaul.

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-legacy/css/buddypress-rtl.css

    r11632 r11905  
    785785    margin: 15px 0 5px;
    786786    width: auto;
     787}
     788
     789#buddypress label.xprofile-field-label {
     790    display: inline;
    787791}
    788792
  • trunk/src/bp-templates/bp-legacy/css/buddypress.css

    r11632 r11905  
    785785    margin: 15px 0 5px;
    786786    width: auto;
     787}
     788
     789#buddypress label.xprofile-field-label {
     790    display: inline;
    787791}
    788792
  • trunk/src/bp-templates/bp-nouveau/common-styles/_bp_user_profile.scss

    r11686 r11905  
    5858                label {
    5959                    font-weight: 400;
     60
     61                    &.xprofile-field-label {
     62                        display: inline;
     63                    }
    6064                }
    6165            }
  • trunk/src/bp-templates/bp-nouveau/css/buddypress-rtl.css

    r11860 r11905  
    26072607.buddypress-wrap .profile.edit .editfield fieldset label {
    26082608    font-weight: 400;
     2609}
     2610
     2611.buddypress-wrap .profile.edit .editfield fieldset label.xprofile-field-label {
     2612    display: inline;
    26092613}
    26102614
  • trunk/src/bp-templates/bp-nouveau/css/buddypress.css

    r11860 r11905  
    26072607.buddypress-wrap .profile.edit .editfield fieldset label {
    26082608    font-weight: 400;
     2609}
     2610
     2611.buddypress-wrap .profile.edit .editfield fieldset label.xprofile-field-label {
     2612    display: inline;
    26092613}
    26102614
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-field-type-datebox.php

    r11749 r11905  
    106106                do_action( bp_get_the_profile_field_errors_action() ); ?>
    107107
    108                 <label for="<?php bp_the_profile_field_input_name(); ?>_day" class="<?php echo is_admin() ? 'screen-reader-text' : 'bp-screen-reader-text' ;?>"><?php
    109                     /* translators: accessibility text */
    110                     esc_html_e( 'Select day', 'buddypress' );
     108                <label for="<?php bp_the_profile_field_input_name(); ?>_day" class="xprofile-field-label"><?php
     109                    esc_html_e( 'Day', 'buddypress' );
    111110                ?></label>
    112111                <select <?php echo $this->get_edit_field_html_elements( $day_r ); ?>>
     
    117116                </select>
    118117
    119                 <label for="<?php bp_the_profile_field_input_name(); ?>_month" class="<?php echo is_admin() ? 'screen-reader-text' : 'bp-screen-reader-text' ;?>"><?php
    120                     /* translators: accessibility text */
    121                     esc_html_e( 'Select month', 'buddypress' );
     118                <label for="<?php bp_the_profile_field_input_name(); ?>_month" class="xprofile-field-label"><?php
     119                    esc_html_e( 'Month', 'buddypress' );
    122120                ?></label>
    123121                <select <?php echo $this->get_edit_field_html_elements( $month_r ); ?>>
     
    128126                </select>
    129127
    130                 <label for="<?php bp_the_profile_field_input_name(); ?>_year" class="<?php echo is_admin() ? 'screen-reader-text' : 'bp-screen-reader-text' ;?>"><?php
    131                     /* translators: accessibility text */
    132                     esc_html_e( 'Select year', 'buddypress' );
     128                <label for="<?php bp_the_profile_field_input_name(); ?>_year" class="xprofile-field-label"><?php
     129                    esc_html_e( 'Year', 'buddypress' );
    133130                ?></label>
    134131                <select <?php echo $this->get_edit_field_html_elements( $year_r ); ?>>
     
    301298        ) ); ?>
    302299
    303         <label for="<?php bp_the_profile_field_input_name(); ?>_day" class="screen-reader-text"><?php
    304             /* translators: accessibility text */
    305             esc_html_e( 'Select day', 'buddypress' );
     300        <label for="<?php bp_the_profile_field_input_name(); ?>_day" class="xprofile-field-label"><?php
     301            esc_html_e( 'Day', 'buddypress' );
    306302        ?></label>
    307303        <select <?php echo $this->get_edit_field_html_elements( $day_r ); ?>>
     
    309305        </select>
    310306
    311         <label for="<?php bp_the_profile_field_input_name(); ?>_month" class="screen-reader-text"><?php
    312             /* translators: accessibility text */
    313             esc_html_e( 'Select month', 'buddypress' );
     307        <label for="<?php bp_the_profile_field_input_name(); ?>_month" class="xprofile-field-label"><?php
     308            esc_html_e( 'Month', 'buddypress' );
    314309        ?></label>
    315310        <select <?php echo $this->get_edit_field_html_elements( $month_r ); ?>>
     
    317312        </select>
    318313
    319         <label for="<?php bp_the_profile_field_input_name(); ?>_year" class="screen-reader-text"><?php
    320             /* translators: accessibility text */
    321             esc_html_e( 'Select year', 'buddypress' );
     314        <label for="<?php bp_the_profile_field_input_name(); ?>_year" class="xprofile-field-label"><?php
     315            esc_html_e( 'Year', 'buddypress' );
    322316        ?></label>
    323317        <select <?php echo $this->get_edit_field_html_elements( $year_r ); ?>>
Note: See TracChangeset for help on using the changeset viewer.