_actions.scss 5.61 KB
Newer Older
Greg Price committed
1 2 3 4 5 6 7 8 9 10
.discussion.container, .discussion-module {

  // discussion - elements - actions
  // ====================

  // UI: general action list
  .post-actions-list,
  .response-actions-list,
  .comment-actions-list {
    @extend %ui-no-list;
11
    @include text-align(right);
Greg Price committed
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51

    .actions-item {
      @include box-sizing(border-box);
      display: block;
      margin: ($baseline/4) 0;

      &.is-hidden {
        display: none;
      }
    }

    .more-wrapper {
      position: relative;
    }
  }

  // ====================

  // UI: general actions dropdown layout
  .actions-dropdown {
    @extend %ui-no-list;
    @extend %ui-depth1;
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    pointer-events: none;
    min-width: ($baseline*6.5);

    &.is-expanded {
      display: block;
      pointer-events: auto;
    }

    .actions-dropdown-list {
      @include box-sizing(border-box);
      box-shadow: 0 1px 1px $shadow-l1;
      position: relative;
      width: 100%;
      border-radius: 3px;
52
      margin: ($baseline/4) 0 0 0;
Greg Price committed
53 54 55 56 57 58 59 60
      border: 1px solid $gray-l3;
      padding: ($baseline/2) ($baseline*0.75);
      background: $white;

      // ui triangle/nub
      &:after,
      &:before {
        bottom: 100%;
61
        @include right(3px);
Greg Price committed
62 63 64 65 66 67 68 69 70 71 72 73
        border: solid transparent;
        content: " ";
        height: 0;
        width: 0;
        position: absolute;
        pointer-events: none;
      }

      &:after {
        border-color: $transparent;
        border-bottom-color: $white;
        border-width: 6px;
74
        @include margin-right(1px);
Greg Price committed
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
      }

      &:before {
        border-color: $transparent;
        border-bottom-color: $gray-l3;
        border-width: 7px;
      }
    }

    .actions-item {
      display: block;
      margin: 0;

      &.is-hidden {
        display: none;
      }
    }
  }

  // ====================

  // UI: general action
  .action-button {
    @include transition(border .5s linear 0s);
    @include box-sizing(border-box);
    display: inline-block;
    border: 1px solid transparent;
102
    border-radius: ($baseline/4);
Greg Price committed
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 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256
    color: $gray-l1;

    .action-icon {
      @extend %t-icon7;
      display: inline-block;
      height: $baseline;
      width: $baseline;
      border: 1px solid $gray-l3;
      border-radius: 3px;
      text-align: center;
      color: $gray-l1;

      .icon {
        vertical-align: middle;
      }
    }

    .action-label {
      @extend %t-copy-sub2;
      display: inline-block;
      vertical-align: middle;
      padding: 0 8px;
      color: $gray-l1;
      opacity: 0;
    }


    &:hover, &:focus {

      .action-label {
        opacity: 1;
      }

      .action-icon {
        border-radius: 0 3px 3px 0;
      }
    }

    // specific button styles
    &.action-follow {

      .action-label {
        color: $blue-d1;
      }

      &.is-checked, &:hover, &:focus {

        .action-icon {
          background-color: $forum-color-following;
          border: 1px solid $blue-d1;
          color: $white;
        }
      }

      &:hover, &:focus {
        border-color: $forum-color-following;
      }
    }

    &.action-vote {

      .action-label {
        opacity: 1;
      }

      &.is-checked, &:hover, &:focus {

        .action-icon {
          background-color: $green-d1;
          border: 1px solid $green-d2;
          color: $white;
        }
      }

      &:hover, &:focus {
        border-color: $green-d2;

        .action-label {
          color: $green-d2;
        }
      }
    }

    &.action-endorse {

      &.is-checked, &:hover, &:focus {

        .action-icon {
          background-color: $blue-d1;
          border: 1px solid $blue-d2;
          color: $white;
        }
      }

      &:hover, &:focus {
        border-color: $blue-d2;

        .action-label {
          color: $blue-d2;
        }
      }
    }

    &.action-answer {

      &.is-checked, &:hover, &:focus {

        .action-icon {
          border: 1px solid $green-d1;
          background-color: $green-d1;
          color: $white;
        }
      }

      &:hover, &:focus {
        border-color: $green-d1;

        .action-label {
          color: $green-d2;
        }
      }
    }

    // more drop-down menu
    &.action-more {
      position: relative;

      &:hover, &:focus {
        border-color: $gray;

        .action-icon {
          border: 1px solid $gray;
          background-color: $gray;
          color: $white;
        }

        .action-label {
          opacity: 1;
          color: $black;
        }
      }
    }
  }

  // ====================

  .actions-dropdown {

    // UI: secondary action
    .action-list-item {
      @extend %t-copy-sub2;
      display: block;
      padding: ($baseline/10) 0;
      white-space: nowrap;
257
      @include text-align(right);
Greg Price committed
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313
      color: $gray-l1;

      &:hover, &:focus {
        color: $link-color;
      }

      .action-icon {
        display: inline-block;
        width: ($baseline/2);
        margin-left: ($baseline/4);
        color: inherit;
      }

      .action-label {
        display: inline-block;
        color: inherit;
      }

      // CASE: checked
      &.is-checked {
        // CASE: pin action
        &.action-pin {
          color: $pink;
        }

        // CASE: report action
        &.action-report {
          color: $pink;
        }

        // CASE: hover for any action
        &:hover, &:focus {
          color: $link-color;
        }
      }
    }
  }

  .action-button, .action-list-item {
    .action-label {
      .label-checked {
        display: none;
      }
    }

    &.is-checked {
      .label-unchecked {
        display: none;
      }

      .label-checked {
        display: inline;
      }
    }
  }
}