_create-edit-post.scss 4.03 KB
Newer Older
Greg Price committed
1 2 3 4
// discussion - views - new post
// ====================

// UI: form structure
5 6
.forum-new-post-form,
.edit-post-form {
7
  @include clearfix();
Greg Price committed
8 9
  box-sizing: border-box;
  margin: 0;
10
  border-radius: $forum-border-radius;
Greg Price committed
11 12
  max-width: 1180px;

13 14 15 16 17
  label,
  .field-label-text {
    -webkit-font-smoothing: initial;
  }

18 19 20 21 22 23 24 25
  .post-type {
    text-shadow: none;
  }

  .post-type {
    margin-bottom: 0;
  }

26
  .post-errors {
27
    margin: 0 0 $baseline;
28 29 30 31
    padding: 0 !important;
    list-style: none !important;
  }

Greg Price committed
32
  .post-field {
33
    margin-bottom: $baseline * 1.5;
Greg Price committed
34 35

    .field-label {
36
      margin: 0;
Greg Price committed
37 38 39

      .field-input {
        display: inline-block;
40
        width: 70%;
41
        vertical-align: top;
42
        &:not([type="text"]) {
43
          border-width: 0;
44 45
          padding: 0;
        }
Greg Price committed
46 47 48
      }

      .field-label-text {
49 50
        margin: $baseline 0 0 0;
        display: block;
Greg Price committed
51 52 53 54 55
      }

      .field-label-text + .field-input {
        width: 75%;
      }
56 57 58 59

      .js-post-title {
        width: 85%;
      }
Greg Price committed
60 61 62 63
    }

    // UI: support text for input fields
    .field-help {
64
      margin: ($baseline / 4) 0 ($baseline / 4) 0;
65
      font-size: $forum-small-font-size;
66 67 68 69 70
      line-height: 1.5;

      &#field_help_post_type {
        margin-top: ($baseline / 2) 0 ($baseline / 3) 0;
      }
71

72 73 74
      &#new-post-editor-description {
          @include padding-left(0);
      }
Greg Price committed
75
    }
76 77 78 79 80

    .field-input {
      padding: 0;
      border: none;
    }
Greg Price committed
81 82 83 84 85 86 87
  }

  .post-options {
    margin-bottom: ($baseline/2);
  }
}

88 89 90 91 92 93 94 95 96 97 98 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
.edit-post-form {
    @include clearfix();
    box-sizing: border-box;
    width: 100%;
    padding-top: 0;

    h1 {
      font-size: $forum-large-font-size;
    }

    .form-row {
      margin-top: $baseline;
    }

    .post-cancel {
      @include float(left);
      @include margin($baseline/2, 0, 0, $baseline*0.75);
    }

    .post-update {
      @include float(left);
      margin-top: ($baseline/2);

      &:hover, &:focus {
        border-color: #222;
      }
    }

    .edit-post-title {
      box-sizing: border-box;
      border: 1px solid $forum-color-border;
      border-radius: $forum-border-radius;
      padding: 0 ($baseline/2);
      width: 100%;
      height: 40px;
      box-shadow: 0 1px 3px $shadow-l1 inset;
      color: $dark-gray;
      font-size: $forum-large-font-size;
      font-family: $sans-serif;
    }
}

Greg Price committed
130 131
// CASE: inline styling
.discussion-module .forum-new-post-form {
132
  background: $forum-color-background;
Greg Price committed
133 134 135 136 137
}

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

// UI: inputs
138 139
.forum-new-post-form,
.edit-post-form {
140 141 142 143 144
  .post-type-input {
    @extend %text-sr;
  }

  .post-type-label {
145
    @include margin(0, $baseline / 2, 0, 0);
146
    @include white-button;
147
    font-size: $forum-base-font-size;
148
    box-sizing: border-box;
149
    display: inline-block;
150 151
    padding: 0 $baseline;
    height: 36px;
152 153
    text-align: center;
    color: $gray-d3;
154
    border: 1px solid $forum-color-border;
155 156 157 158
    font-weight: 600;
    line-height: 36px;

    .icon {
159
      @include margin-right($baseline/4);
160 161 162 163
    }
  }

  .post-type-input:checked + .post-type-label {
164
    border: none;
165
    background-color: $forum-color-active-thread;
166
    color: $forum-color-active-text;
167
    background-image: none;
168
    box-shadow: none;
169 170 171 172 173 174
  }

  .post-type-input:focus + .post-type-label {
    box-shadow: 0 1px 1px rgba(0, 0,  0, 0.4) inset, 0 0 2px 2px $blue;
  }

Greg Price committed
175
  input[type=text].field-input {
176 177
    box-sizing: border-box;
    border: 1px solid $forum-color-border;
178
    border-radius: $forum-border-radius;
Greg Price committed
179 180 181
    padding: 0 $baseline/2;
    height: 40px;
    color: #333;
182
    font-size: $forum-large-font-size;
Greg Price committed
183 184 185
    font-family: 'Open Sans', sans-serif;
  }

186 187 188 189 190
  select.field-input {
    border: 1px solid $forum-color-border !important;  // !important required to override -webkit-appearance
    height: 40px;
  }

Greg Price committed
191
  .post-option {
192
    box-sizing: border-box;
Greg Price committed
193
    display: inline-block;
194
    @include margin-right($baseline);
195
    border-radius: $forum-border-radius;
Greg Price committed
196
    padding: ($baseline/2);
197
    cursor: pointer;
Greg Price committed
198 199

    &:hover {
200
      border-color: $forum-color-border;
Greg Price committed
201 202 203
    }

    .icon {
204
      @include margin-right($baseline / 4);
Greg Price committed
205 206 207
    }
  }
}