_thread.scss 7 KB
Newer Older
Greg Price committed
1 2
// discussion - thread layout
// ====================
3
// NOTE: thread = (post + (responses and comments))
Greg Price committed
4

5
// Table of Contents
6 7 8 9 10 11
// * +general thread layout
// * +thread - wrapper styling
// * +thread - elements - shared styles
// * +post - individual element styling
// * +post - answered question - collapsed comment area

12 13
// post layout
.discussion-post {
14
    padding: 0 ($baseline/2);
Greg Price committed
15

16
    .wrapper-post-header {
17
        padding-bottom: 0;
18 19
    }

Greg Price committed
20
    .post-header-content {
21 22
        display: inline-block;
        width: flex-grid(9,12);
Greg Price committed
23 24 25
    }

    .post-header-actions {
26
        @include float(right);
Greg Price committed
27
    }
28

29
    .post-body {
30
        width: flex-grid(10,12);
31
    }
32
}
33

34
.posted-details {
35
    @extend %t-copy-sub2;
36
    margin: ($baseline/5) 0;
37 38 39
    color: $gray-d1;

    .username {
40 41
        @extend %t-strong;
        display: inline;
42 43 44
    }

    .timeago, .top-post-status {
45
        color: inherit;
46
    }
47
}
Greg Price committed
48

49 50
// response layout
.discussion-response {
51
    min-height: ($baseline*5);
52

Greg Price committed
53
    .response-header-content {
54 55 56
        display: inline-block;
        vertical-align: top;
        width: flex-grid(11,12);
Greg Price committed
57 58 59
    }

    .response-header-actions {
60 61 62 63
        @include float(right);
        @include right($baseline);
        position: absolute;
        top: $baseline;
Greg Price committed
64
    }
65
}
Greg Price committed
66

67 68
// comments layout
.discussion-comment {
Greg Price committed
69 70

    .response-body {
71 72 73 74 75 76 77 78
        @extend %t-copy-sub2;
        display: inline-block;
        margin-bottom: ($baseline/2);
        width: flex-grid(10,12);

        p + p {
            margin-top: 12px;
        }
Greg Price committed
79 80 81
    }

    .comment-actions-list {
82
        @include float(right);
83 84 85
        @include right($baseline / 2);
        position: absolute;
        top: $baseline / 2;
Greg Price committed
86 87 88
    }
}

89
// +thread - wrapper styling
90
.thread-wrapper {
91 92 93
    .thread-main-wrapper {
        padding-bottom: $baseline;
    }
94 95
}

96 97 98
// +thread - elements - shared styles
body.discussion {

99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
    .discussion-post, .discussion-response, .discussion-comment {
        @include clearfix();

        // thread - images
        .author-image {
            @include margin-right($baseline/2);
            display: inline-block;
            vertical-align: top;

            // STATE: No profile image
            &:empty {
                display: none;
            }

            // CASE: post image
            &.level-post {
                height: $post-image-dimension;
                width: $post-image-dimension;
            }

            // CASE: response image
            &.level-response {
                height: $response-image-dimension;
                width: $response-image-dimension;
            }

            // CASE: comment image
            &.level-comment {
                height: $comment-image-dimension;
                width: $comment-image-dimension;
            }

            img {
132
                border-radius: $forum-border-radius;
133 134
            }
        }
135 136
    }

137 138 139
    .discussion-response .response-body {
        @include padding-right($baseline); //ensures content doesn't overlap on post or response actions.
    }
140 141 142
}

// +post - individual element styling
143 144 145
// NOTE: discussion-article is used for inline discussion modules.
.discussion-post,
.discussion-article {
146
    @include clearfix();
147

148
    .post-header-content {
149

150 151
        // post title
        .post-title {
152
            font-size: $forum-x-large-font-size;
153 154
            margin-bottom: ($baseline/4);
        }
155 156
    }

157 158 159 160
    // post body
    .post-body {
        @extend %t-copy-sub1;
        // clear: both; //TO-DO: confirm that removing this is ok for all cases of discussion posts.
161 162
    }

163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
    // post context
    .post-context {
        @extend %t-copy-sub2;
        margin-top: $baseline;
        color: $gray-d1;

        // CASE: no courseware context or cohort visibility rules
        &:empty {
            display: none;
        }

        // post visibility - cohorts
        .group-visibility-label {
            margin-top: ($baseline/4);
        }
178 179 180
    }
}

181 182 183 184 185 186 187 188 189 190
// Styling for discussion threads
.discussion-thread {
    padding: 0;
    margin-bottom: $baseline;
    @include transition(all .25s linear 0s);

    p {
        margin-bottom: 0;
    }

191
    .thread-main-wrapper, .thread-responses-wrapper {
192
        padding: $baseline;
193
    }
Greg Price committed
194

195 196 197
    .discussion-article {
        @include transition(all .2s linear 0s);
        border: 1px solid $forum-color-border;
198
        border-radius: $forum-border-radius;
199 200 201 202 203 204
        min-height: 0;
        background: $forum-color-background;
        box-shadow: 0 1px 0 $shadow;
        @include transition(all .2s linear 0s);

        .thread-wrapper {
205
            @include border-radius($forum-border-radius, $forum-border-radius, 0, 0);
206 207 208 209 210 211 212 213 214
            position: relative;
            overflow-x: hidden;
            overflow-y: auto;
            max-height: 600px;
            background-color: $forum-color-background;

            .discussion-post {

                .inline-comment-count {
215
                    @include margin-right($baseline/2);
216
                    @extend %ui-depth2;
217
                    @include float(right);
218 219 220 221 222
                    position: relative;
                    display: block;
                    height: 27px;
                    margin-top: 6px;
                    padding: 0 8px;
223 224
                    border-radius: $forum-border-radius;
                    font-size: $forum-small-font-size;
225 226 227 228 229 230 231 232 233 234 235 236
                    font-weight: 400;
                    line-height: 25px;
                    color: #888;
                }
            }

            .responses {
                header {
                    padding-bottom: 0;
                    margin-bottom: ($baseline*0.75);

                    .posted-by {
237 238 239
                        @include margin-right($baseline/4);
                        @include float(left);
                        font-size: $forum-large-font-size;
240 241 242 243 244
                    }
                }

                .response-body {
                    margin-bottom: 0.2em;
245
                    font-size: $forum-base-font-size;
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262
                }
            }

            .discussion-reply-new {
                .wmd-input {
                    height: 120px;
                }
            }

            // Content that is hidden by default in the inline view
            .post-extended-content {
                display: none;
            }
        }

        .post-tools {
            box-shadow: 0 1px 1px $shadow inset;
263
            background: $white;
264 265

            &:hover {
266
                background: $forum-color-hover-thread;
267 268 269 270 271 272

                .icon {
                    color: $link-hover;
                }
            }

273
            .btn-link {
274 275
                display: block;
                padding: ($baseline*0.25) $baseline;
276
                font-size: $forum-small-font-size;
277 278 279
                line-height: 30px;

                .icon {
280
                    @include margin-right($baseline*0.25);
281 282 283 284 285 286
                    color: $link-color;
                }
            }
        }
    }
}
287

288 289 290 291
// Custom styling for the list of user threads
.discussion-user-threads {
    .discussion-post {
        padding: $baseline/2;
292 293
    }
}
294 295 296 297 298 299 300

.thread-wrapper,
.forum-new-post-form {
  img {
    max-width: 100%;
  }
}