Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/10/2017 11:07:44 AM (9 years ago)
Author:
hnla
Message:

Add styles for BP widgets

Commit adds styling for BP widgets to display as grid layout & attempts to adjust for various device width views.

Styles split as global & as displayed if added to a generic WP sidebar classed with default widget-area.

N.B .min files omitted as these should be part of future build process, however .rtl included

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-nouveau/common-styles/_bp_widgets.scss

    r11686 r11713  
     1// BP Widgets
     2
     3.buddypress.widget {
     4
     5        .item-options {
     6
     7                @include font-size(14);
     8        }
     9
     10        ul.item-list {
     11
     12                @include flex-box-dir($flex-dir: column);
     13
     14                @include medium-small-up() {
     15
     16                        @include flex-box-dir($flex-dir: row, $flex-wrap: wrap);
     17                }
     18
     19                list-style: none;
     20                margin: $marg-sml -2%;
     21                overflow: hidden;
     22
     23                li {
     24                        border: 1px solid $bp-border-color;
     25
     26                        @include flex-align();
     27                        @include box-item-size($grow: 1, $basis: 46%);
     28
     29                        @include large-up() {
     30
     31                                @include box-item-size($grow: 0, $basis: 20%);
     32                        }
     33
     34                        margin: 2%;
     35
     36                        .item-avatar {
     37                                padding: $pad-sml;
     38                                text-align: center;
     39
     40                                .avatar {
     41                                        width: 60%;
     42                                }
     43                        }
     44
     45                        .item {
     46                                padding: 0 $pad-sml $pad-sml;
     47
     48
     49                                .item-meta {
     50
     51                                        @include font-size(12);
     52                                        overflow-wrap: break-word;
     53                                }
     54                        }
     55                } // close li
     56        }
     57}
     58
     59// Are we in a main site sidebar?
     60// while hard to tell width asume that
     61// at large width it's narrow &
     62// adjust the li widths & margins to %
     63// & flex basis to auto for large up.
     64// @todo this may need reviewing & adjusting.
     65
     66// WP default themes use the class '.widget-area'
     67// as a naming convention for the main sidebar
     68// this is the best we can know & style on this class
     69.widget-area {
     70
     71        .buddypress.widget {
     72
     73                ul.item-list {
     74
     75                        li {
     76
     77                                @include box-item-size($grow: 0, $basis: 46%);
     78                                margin: 2% 2% 10px;
     79
     80                                @include large-up {
     81
     82                                        .avatar {
     83                                                width: 100%;
     84                                        }
     85                                }
     86                        }
     87                }
     88
     89                @include large-up() {
     90
     91                        ul.item-list {
     92                                margin: $marg-sml -2%;
     93                                width: 100%;
     94
     95                                li {
     96
     97                                        @include box-item-size($grow: 0, $basis: auto);
     98                                        margin: $marg-sml 2% 1%;
     99                                        width: 46%;
     100                                }
     101                        }
     102                }
     103        }
     104}
Note: See TracChangeset for help on using the changeset viewer.