Skip to:
Content

BuddyPress.org

Changeset 12814


Ignore:
Timestamp:
12/04/2020 06:13:48 PM (6 years ago)
Author:
imath
Message:

BP Nouveau gets ready for Twenty Twenty-One

Improve the BP Nouveau template pack to make BuddyPress appearance looks great into the next WordPress default theme (Twenty Twenty-One).

Use the companion stylesheet feature to only load CSS rules specific to Twenty Twenty-One if it is the active theme or the parent of the active theme.

Props vapvarun

Fixes #8395

Location:
trunk
Files:
3 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/Gruntfile.js

    r12751 r12814  
    3333                        '!bp-templates/bp-legacy/css/twenty*.css',
    3434                        '!bp-templates/bp-nouveau/css/buddypress.css',
     35                        '!bp-templates/bp-nouveau/css/twenty*.css',
    3536                        '!bp-core/admin/css/hello.css',
    3637                        '!bp-members/css/blocks/member.css',
     
    118119                                ext: '.css',
    119120                                flatten: true,
    120                                 src: ['bp-templates/bp-nouveau/sass/buddypress.scss'],
     121                                src: ['bp-templates/bp-nouveau/sass/buddypress.scss', 'bp-templates/bp-nouveau/sass/twenty*.scss'],
    121122                                dest: SOURCE_DIR + 'bp-templates/bp-nouveau/css/'
    122123                        },
     
    403404         */
    404405        grunt.registerTask( 'src', ['checkDependencies', 'jsvalidate:src', 'jshint', 'stylelint', 'sass', 'postcss', 'rtlcss'] );
     406        grunt.registerTask( 'style', ['stylelint', 'sass', 'postcss', 'rtlcss'] );
    405407        grunt.registerTask( 'makepot', ['exec:makepot'] );
    406408        grunt.registerTask( 'commit', ['src', 'checktextdomain', 'imagemin', 'phplint', 'exec:phpcompat'] );
  • trunk/src/bp-templates/bp-nouveau/buddypress-functions.php

    r12595 r12814  
    284284                        }
    285285                }
     286
     287                // Compatibility stylesheets for specific themes.
     288                $theme                = get_template();
     289                $companion_stylesheet = bp_locate_template_asset( sprintf( 'css/%1$s%2$s.css', $theme, $min ) );
     290                $companion_handle     = 'bp-' . $theme;
     291
     292                if ( ! is_rtl() && isset( $companion_stylesheet['uri'] ) && $companion_stylesheet['uri'] ) {
     293                        wp_enqueue_style( $companion_handle, $companion_stylesheet['uri'], array(), $this->version, 'screen' );
     294
     295                        if ( $min ) {
     296                                wp_style_add_data( $companion_handle, 'suffix', $min );
     297                        }
     298                }
     299
     300                // Compatibility stylesheet for specific themes, RTL-version.
     301                if ( is_rtl() ) {
     302                        $rtl_companion_stylesheet = bp_locate_template_asset( sprintf( 'css/%1$s-rtl%2$s.css', $theme, $min ) );
     303
     304                        if ( isset( $rtl_companion_stylesheet['uri'] ) ) {
     305                                $companion_handle .= '-rtl';
     306                                wp_enqueue_style( $companion_handle, $rtl_companion_stylesheet['uri'], array(), $this->version, 'screen' );
     307
     308                                if ( $min ) {
     309                                        wp_style_add_data( $companion_handle, 'suffix', $min );
     310                                }
     311                        }
     312                }
    286313        }
    287314
  • trunk/src/bp-templates/bp-nouveau/buddypress/groups/single/admin/group-cover-image.php

    r12156 r12814  
    44 *
    55 * @since 3.0.0
    6  * @version 3.1.0
     6 * @version 7.0.0
    77 */
    88?>
     
    1010<?php if ( bp_is_group_create() ) : ?>
    1111
    12         <h2 class="bp-screen-title creation-step-name">
     12        <h3 class="bp-screen-title creation-step-name">
    1313                <?php esc_html_e( 'Upload Cover Image', 'buddypress' ); ?>
    14         </h2>
     14        </h3>
    1515
    1616        <div id="header-cover-image"></div>
  • trunk/src/bp-templates/bp-nouveau/common-styles/_bp_forms.scss

    r12398 r12814  
    11// BP Forms Elements Global Styles
    22// @since 3.0.0
    3 // @version 5.0.0
     3// @version 7.0.0
    44
    55// Some essential classes used for forms elements:
     
    8888                .groups-members-search input[type="search"],
    8989                .groups-members-search input[type="text"] {
    90                         background: $off-white;
     90                        background-color: $off-white;
    9191                        border: 1px solid $form-border-color;
    9292                        border-radius: 0;
     
    164164                textarea:focus,
    165165                select:focus {
    166                         background: $off-white;
     166                        background-color: $off-white;
    167167                        color: $bp-text;
    168168                        outline: 0;
  • trunk/src/bp-templates/bp-nouveau/common-styles/_bp_generic_and_typography.scss

    r12537 r12814  
    11// BP Generic elements, Typography and Images.
    22// @since 3.0.0
    3 // @version 5.0.0
     3// @version 7.0.0
    44
    55// ========= Generic Sitewide elements ========
     
    6060                .site-content .entry-header,
    6161                .entry-content {
    62                         max-width: none;
     62
     63                        &:not(.alignwide):not(.alignfull) {
     64                                max-width: none;
     65                        }
    6366                }
    6467
     
    167170                        padding: 0;
    168171
    169                         .entry-title {
     172                        &:not(.alignwide):not(.alignfull) .entry-title {
    170173
    171174                                @include responsive-font(34);
  • trunk/src/bp-templates/bp-nouveau/common-styles/_bp_info_messages.scss

    r12734 r12814  
    2929                        display: block;
    3030                }
    31 
    32                 // Error message boxes
    33                 &.error {
    34 
    35                         p {
    36                                 // oh linter you're too boringly pedantic, there will be properties!
    37                         }
    38                 }
    39 
    40                 // Warning boxes
    41                 //              &.warning {
    42 
    43                 //                      p {
    44                 //                      }
    45                 //              }
    46 
    4731        } // close .bp-messages
    4832
  • trunk/src/bp-templates/bp-nouveau/common-styles/_bp_layouts.scss

    r12582 r12814  
    44// The sheet also adds layout properties such as border-box
    55// @since 3.0.0
    6 // @version 6.0.0
     6// @version 7.0.0
    77
    88#item-body,
     
    433433        }
    434434
    435         .grid.members-list, {
     435        .grid.members-list {
    436436
    437437                .list-wrap {
     
    440440        }
    441441
    442         .grid.blogs-list, {
     442        .grid.blogs-list {
    443443
    444444                .list-wrap {
  • trunk/src/bp-templates/bp-nouveau/common-styles/_bp_navigation.scss

    r12582 r12814  
    11// BP primary & secondary navigation - directory and single screens
    2 // @version 3.0.0
     2// @since 3.0.0
     3// @version 7.0.0
    34
    45// all devices & generic styles sitewide
     
    101102
    102103                li:not(.current),
    103                 li:not(.selected), {
     104                li:not(.selected) {
    104105
    105106                        a:focus,
     
    252253                }
    253254        }
    254 
    255255} // close .buddypress-wrap
    256256
     
    422422
    423423        } // close @media
    424 
    425424} // close .buddypress-wrap
    426425
     
    441440                        }
    442441                }
    443 
    444442        }
    445443}
  • trunk/src/bp-templates/bp-nouveau/common-styles/_bp_search.scss

    r12405 r12814  
    11// BP Directory Search elements
    22// @since 3.0.0
    3 // @version 5.0.0
     3// @version 7.0.0
    44
    55.buddypress-wrap { // the ID is required to add weight to rules
     
    3131                input[type="text"] {
    3232                        float: left;
    33                         line-height: 1.5;
     33                        line-height: 2;
    3434                        padding: 3px 10px;
    35                         width: 80%;
     35                        width: 78%;
    3636                }
    3737
  • trunk/src/bp-templates/bp-nouveau/common-styles/_bp_tables.scss

    r12082 r12814  
    11// BP default/generic Table styles.
    2 // @version 3.0.0
     2// @since 3.0.0
     3// @version 7.0.0
    34.buddypress-wrap {
    45
     
    5960
    6061        .bp-tables-user,
    61         table.wp-profile-fields, {
     62        table.wp-profile-fields {
    6263
    6364                tr.alt {
  • trunk/src/bp-templates/bp-nouveau/css/buddypress-rtl.css

    r12797 r12814  
    8484
    8585@media screen and (min-width: 46.8em) {
    86         body.buddypress .entry-header,
    87         body.buddypress .site-content .entry-header,
    88         body.buddypress .entry-content {
     86        body.buddypress .entry-header:not(.alignwide):not(.alignfull),
     87        body.buddypress .site-content .entry-header:not(.alignwide):not(.alignfull),
     88        body.buddypress .entry-content:not(.alignwide):not(.alignfull) {
    8989                max-width: none;
    9090        }
     
    143143}
    144144
    145 body.buddypress article.page > .entry-header .entry-title {
     145body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .entry-title {
    146146        font-size: 28px;
    147147        font-weight: inherit;
     
    150150
    151151@media screen and (min-width: 46.8em) {
    152         body.buddypress article.page > .entry-header .entry-title {
     152        body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .entry-title {
    153153                font-size: 34px;
    154154        }
     
    34823482.buddypress-wrap .standard-form .groups-members-search input[type="search"],
    34833483.buddypress-wrap .standard-form .groups-members-search input[type="text"] {
    3484         background: #fafafa;
     3484        background-color: #fafafa;
    34853485        border: 1px solid #d6d6d6;
    34863486        border-radius: 0;
     
    35533553.buddypress-wrap .standard-form textarea:focus,
    35543554.buddypress-wrap .standard-form select:focus {
    3555         background: #fafafa;
     3555        background-color: #fafafa;
    35563556        color: #555;
    35573557        outline: 0;
     
    37923792.buddypress-wrap form#group-members-search input[type="text"] {
    37933793        float: right;
    3794         line-height: 1.5;
     3794        line-height: 2;
    37953795        padding: 3px 10px;
    3796         width: 80%;
     3796        width: 78%;
    37973797}
    37983798
  • trunk/src/bp-templates/bp-nouveau/css/buddypress.css

    r12797 r12814  
    8484
    8585@media screen and (min-width: 46.8em) {
    86         body.buddypress .entry-header,
    87         body.buddypress .site-content .entry-header,
    88         body.buddypress .entry-content {
     86        body.buddypress .entry-header:not(.alignwide):not(.alignfull),
     87        body.buddypress .site-content .entry-header:not(.alignwide):not(.alignfull),
     88        body.buddypress .entry-content:not(.alignwide):not(.alignfull) {
    8989                max-width: none;
    9090        }
     
    143143}
    144144
    145 body.buddypress article.page > .entry-header .entry-title {
     145body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .entry-title {
    146146        font-size: 28px;
    147147        font-weight: inherit;
     
    150150
    151151@media screen and (min-width: 46.8em) {
    152         body.buddypress article.page > .entry-header .entry-title {
     152        body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .entry-title {
    153153                font-size: 34px;
    154154        }
     
    34823482.buddypress-wrap .standard-form .groups-members-search input[type="search"],
    34833483.buddypress-wrap .standard-form .groups-members-search input[type="text"] {
    3484         background: #fafafa;
     3484        background-color: #fafafa;
    34853485        border: 1px solid #d6d6d6;
    34863486        border-radius: 0;
     
    35533553.buddypress-wrap .standard-form textarea:focus,
    35543554.buddypress-wrap .standard-form select:focus {
    3555         background: #fafafa;
     3555        background-color: #fafafa;
    35563556        color: #555;
    35573557        outline: 0;
     
    37923792.buddypress-wrap form#group-members-search input[type="text"] {
    37933793        float: left;
    3794         line-height: 1.5;
     3794        line-height: 2;
    37953795        padding: 3px 10px;
    3796         width: 80%;
     3796        width: 78%;
    37973797}
    37983798
  • trunk/src/bp-templates/bp-nouveau/includes/activity/functions.php

    r12595 r12814  
    44 *
    55 * @since 3.0.0
    6  * @version 5.0.0
     6 * @version 7.0.0
    77 */
    88
     
    539539        ) );
    540540}
     541
     542/**
     543 * Remove brackets around the "Read more" text.
     544 *
     545 * @since 7.0.0
     546 *
     547 * @param string $read_more The read more text.
     548 * @return string The read more text without brackets.
     549 */
     550function bp_nouveau_activity_excerpt_append_text( $read_more = '' ) {
     551        /**
     552         * As this was added during a string freeze period, we
     553         * are using the `str_replace()` function.
     554         */
     555        return str_replace( array( '[', ']' ), '', $read_more );
     556}
     557add_filter( 'bp_activity_excerpt_append_text', 'bp_nouveau_activity_excerpt_append_text', 10, 1 );
  • trunk/src/bp-templates/bp-nouveau/includes/template-tags.php

    r12774 r12814  
    14491449         *
    14501450         * @since 3.0.0
     1451         * @since 7.0.0 Add a class to inform about the active Theme.
    14511452         *
    14521453         * @return string CSS classes
    14531454         */
    14541455        function bp_nouveau_get_container_classes() {
    1455                 $classes           = array( 'buddypress-wrap' );
     1456                $classes           = array( 'buddypress-wrap', get_template() );
    14561457                $component         = bp_current_component();
    14571458                $bp_nouveau        = bp_nouveau();
Note: See TracChangeset for help on using the changeset viewer.