View
Sorce
1 2 3 4 5 6 7 8 9 10 11 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 52 | <input placeholder="一行テキスト text" type="text"> <input placeholder="パスワード password" type="password"> <input placeholder="検索キーワード search" type="search"> <input placeholder="電話番号 tel" type="tel"> <input placeholder="URL url" type="url"> <input placeholder="メールアドレス email" type="email"> <input placeholder="日時(タイムゾーン有) datetime" type="datetime"> <input placeholder="日時(タイムゾーン無) datetime-local" type="datetime-local"> <input placeholder="日 date" type="date"> <input placeholder="月 month" type="month"> <input placeholder="週 week" type="week"> <input placeholder="時間(タイムゾーン無) time" type="time"> <inptu placeholder="数値 number"type="number"> <textarea placeholder="テキストエリア入力"></textarea> <input type="checkbox" name="checksample" id="checksample"><label for="checksample">チェックボックス::<label>タグに id+for で紐づけるタイプ</label> <label><input type="checkbox" name="checksample"><span>チェックボックス:全体を<label>タグで囲み、テキストを<span>で囲むタイプ</span></span></label> <input type="radio" name="radiosample" id="radiosample"><label for="radiosample">ラジオボタン:<label>タグに id+for で紐づけるタイプ</label> <label><input type="radio" name="radiosample"><span>ラジオボタン:全体を<label>タグで囲み、テキストを<span>で囲むタイプ</span></label> <label class="select"> <select> <optgroup label="グループ1"> <option>項目1</option> <option>項目2</option> <option>項目3</option> <option>項目4</option> <option>項目5</option> </optgroup> <optgroup label="グループ2"> <option>項目1</option> <option>項目2</option> <option>項目3</option> <option>項目4</option> <option>項目5</option> </optgroup> </select> </label> <select multiple> <optgroup label="グループ1"> <option>項目1</option> <option>項目2</option> <option>項目3</option> <option>項目4</option> <option>項目5</option> </optgroup> <optgroup label="グループ2"> <option>項目1</option> <option>項目2</option> <option>項目3</option> <option>項目4</option> <option>項目5</option> </optgroup> </select> |
1 2 3 4 5 6 7 8 9 10 11 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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 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 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 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 | /* ==================================================== フォームパーツ ==================================================== */ input[type="text"], input[type="password"], input[type="search"], input[type="tel"], input[type="url"], input[type="email"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="week"], input[type="time"], input[type="number"] { -webkit-appearance: none; -moz-appearance: none; appearance: none; box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.1); border: 1px solid #999999; border-radius: 2px; background-color: #ffffff; max-width: 100%; padding: 0.25em 0.5em; font-size: 1rem; color: #666 !important; font-family: "游ゴシック Medium", "YuGothic Medium", "游ゴシック体", YuGothic, "メイリオ", "Meiryo", "ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", sans-serif; } select, textarea { -webkit-appearance: none; -moz-appearance: none; appearance: none; box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.1); border: 1px solid #999999; border-radius: 2px; background-color: #ffffff; max-width: 100%; padding: 0.25em 0.5em; font-size: 1rem; color: #666 !important; font-family: "游ゴシック Medium", "YuGothic Medium", "游ゴシック体", YuGothic, "メイリオ", "Meiryo", "ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", sans-serif; } input[type="text"], input[type="password"], input[type="search"], input[type="tel"], input[type="url"], input[type="email"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="week"], input[type="time"], input[type="number"] { height: 2.25em; } textarea { width: 100%; height: 6em; } select { padding-right: 1.75em; } select:not([multiple]) { box-shadow: none; background: -moz-linear-gradient(top, white 0%, rgba(0, 0, 0, 0.15) 100%); background: -webkit-linear-gradient(top, white 0%, rgba(0, 0, 0, 0.15) 100%); background: linear-gradient(to bottom, white 0%, rgba(0, 0, 0, 0.15) 100%); margin: 0; } -webkit-input-placeholder, -ms-input-placeholder, -moz-placeholder { color: #999; } input[type="text"]:focus, input[type="password"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="url"]:focus, input[type="email"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="date"]:focus, input[type="month"]:focus, input[type="week"]:focus, input[type="time"]:focus, input[type="number"]:focus { border-color: #f00; box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.6); } select:focus, textarea:focus { border-color: #f00; box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.6); } select:not([multiple]):focus { box-shadow: none; } label.select { display: inline-block; position: relative; line-height: 0; } label.select:before, label.select:after { display: inline-block; position: absolute; font-size: 0.5rem; } label.select:before { content: ""; border-left: 1px solid #999999; right: 3em; height: 100%; } label.select:after { pointer-events: none; content: "▼"; top: 50%; transform: translateY(-50%); right: 1em; line-height: 1; color: #777777; } input[type="checkbox"], input[type="radio"] { display: none; } input[type="checkbox"] + label, input[type="checkbox"] + span { position: relative; padding-left: 1.5em; cursor: pointer; } input[type="radio"] + label, input[type="radio"] + span { position: relative; padding-left: 1.5em; cursor: pointer; } input[type="checkbox"] + label:before, input[type="checkbox"] + span:before, input[type="radio"] + label:before, input[type="radio"] + span:before { content: ""; display: inline-block; position: absolute; top: 50%; left: 0.25em; transform: translateY(-50%); font-family: FontAwesome; } input[type="checkbox"] + label:before, input[type="checkbox"] + span:before { content: "\f096"; } input[type="radio"] + label:before, input[type="radio"] + span:before { content: "\f10c"; } input[type="checkbox"]:checked + label:before, input[type="checkbox"]:checked + span:before { content: "\f046"; } input[type="radio"]:checked + label:before, input[type="radio"]:checked + span:before { content: "\f192"; } @media screen and (max-width: 767px) { input[type="checkbox"] + label, input[type="checkbox"] + span, input[type="radio"] + label, input[type="radio"] + span { display: block; padding-top: 0.5em; padding-bottom: 0.5em; } input[type="checkbox"]:checked + label, input[type="checkbox"]:checked + span, input[type="radio"]:checked + label, input[type="radio"]:checked + span { background-color: #f0f0ff; } } |
1 2 3 4 5 6 7 8 9 10 11 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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 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 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 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 | //入力枠スタイル @mixin formPartsStyle { -webkit-appearance: none; -moz-appearance: none; appearance: none; box-shadow:inset 1px 1px 3px rgba(0,0,0,0.1); border:1px solid #999999; border-radius:2px; background-color:#ffffff; max-width: 100%; padding: 0.25em 0.5em; font-size:1rem; color:$text_color !important; font-family:$base_font_family_sans; } //入力枠スタイル(Focus) @mixin formForcusStyle { border-color:#f00; box-shadow:inset 1px 1px 3px rgba(0,0,0,0.6); } //入力例、Placeholder スタイル @mixin formPlaceholderText { color:#999; } //チェックボックス デフォルト @mixin checkMarkDef {content:"\f096";} //チェックボックス チェックマーク @mixin checkMarkCheck {content:"\f10c";} //ラジオボタン デフォルト @mixin radioMarkDef {content:"\f046";} //ラジオボタン チェックマーク @mixin radioMarkCheck {content:"\f192";} //チェック・ラジオボタン チェック色 @mixin formRadioCheckColor { background-color:#f0f0ff; } //================ 設定ここまで ================= // ==================================================== // 入力枠基本スタイル // ==================================================== input { &[type="text"], &[type="password"], &[type="search"], &[type="tel"], &[type="url"], &[type="email"], &[type="datetime"], &[type="datetime-local"], &[type="date"], &[type="month"], &[type="week"], &[type="time"], &[type="number"]{ @include formPartsStyle; } } select, textarea { @include formPartsStyle; } input { &[type="text"], &[type="password"], &[type="search"], &[type="tel"], &[type="url"], &[type="email"], &[type="datetime"], &[type="datetime-local"], &[type="date"], &[type="month"], &[type="week"], &[type="time"], &[type="number"]{ height: 2.25em; } } textarea { width: 100%; height: 6em; } select { padding-right:1.75em; &:not([multiple]) { box-shadow: none; background: -moz-linear-gradient(top, rgba(255, 255, 255, 1) 0%, rgba(0, 0, 0, 0.15) 100%); background: -webkit-linear-gradient(top, rgba(255, 255, 255, 1) 0%, rgba(0, 0, 0, 0.15) 100%); background: linear-gradient(to bottom, rgba(255, 255, 255, 1) 0%, rgba(0, 0, 0, 0.15) 100%); margin: 0; } } // ==================================================== // placeHolderスタイル // ==================================================== -webkit-input-placeholder, -ms-input-placeholder, -moz-placeholder {@include formPlaceholderText;} // ==================================================== // 選択時スタイル // ==================================================== input { &[type="text"]:focus, &[type="password"]:focus, &[type="search"]:focus, &[type="tel"]:focus, &[type="url"]:focus, &[type="email"]:focus, &[type="datetime"]:focus, &[type="datetime-local"]:focus, &[type="date"]:focus, &[type="month"]:focus, &[type="week"]:focus, &[type="time"]:focus, &[type="number"]:focus { @include formForcusStyle; } } select:focus, textarea:focus { @include formForcusStyle; } select:not([multiple]):focus { box-shadow: none; } // ==================================================== // セレクトメニュースタイル // ==================================================== label.select { display: inline-block; position: relative; line-height: 0; &:before, &:after { display: inline-block; position: absolute; font-size: 0.5rem; } &:before { content: ""; border-left: 1px solid #999999; right: 3em; height: 100%; } &:after { pointer-events: none; content: "▼"; top: 50%; transform: translateY(-50%); right: 1em; line-height: 1; color: #777777; } } // ==================================================== // ラジオボタン・チェックボックス // ==================================================== input { &[type="checkbox"], &[type="radio"] { display: none; } &[type="checkbox"] + { label, span { position: relative; padding-left: 1.5em; cursor: pointer; } } &[type="radio"] + { label, span { position: relative; padding-left: 1.5em; cursor: pointer; } } &[type="checkbox"] + label:before, &[type="checkbox"] + span:before, &[type="radio"] + label:before, &[type="radio"] + span:before { content: ""; display: inline-block; position: absolute; top: 50%; left: 0.25em; transform:translateY(-50%); font-family: FontAwesome; } &[type="checkbox"] + label:before, &[type="checkbox"] + span:before {@include checkMarkDef;} &[type="radio"] + label:before, &[type="radio"] + span:before {@include checkMarkCheck;} &[type="checkbox"]:checked + label:before, &[type="checkbox"]:checked + span:before {@include radioMarkDef;} &[type="radio"]:checked + label:before, &[type="radio"]:checked + span:before {@include radioMarkCheck;} } @media screen and (max-width: 767px) { // ==================================================== // xs時 ラジオボタン・チェックボックス ラベル範囲 // ==================================================== input { &[type="checkbox"] + label, &[type="checkbox"] + span, &[type="radio"] + label, &[type="radio"] + span { display: block; padding-top:0.5em; padding-bottom:0.5em; } &[type="checkbox"]:checked + label, &[type="checkbox"]:checked + span, &[type="radio"]:checked + label, &[type="radio"]:checked + span { @include formRadioCheckColor; } } } |