UNPKG

8.63 kBSCSSView Raw
1/*! Neo's Normalize http://neo.s21.xrea.com/ */
2
3
4// ==================================================
5// SCSS 変数定義
6// ==================================================
7
8$nn-grey-bg : #f2f4f6 !default;
9$nn-grey-border : #d2d4d6 !default;
10$nn-green-bg : #dfe !default;
11$nn-green-border: #0da !default;
12// サンセリフ (ゴシック体)
13// 1. 英字 … Mac iOS … -apple-system, BlinkMacSystemFont,
14// 2. 英字 … Mac iOS … "Helvetica Neue",
15// 3. 英字 … Mac Win iOS Android … Helvetica, (= Arial on Windows, Roboto on Android)
16// 4. 和英 … Mac Win … YuGothic, "Yu Gothic", (With @font-face)
17// 5. 和英 … Mac iOS … "Hiragino Sans", "Hiragino Kaku Gothic ProN",
18// 6. 和英 … Win … Meiryo,
19// 7. 全般 … … sans-serif,
20// 8. 絵文字 … Mac iOS … "Apple Color Emoji",
21// 9. 絵文字 … Win … "Segoe UI Emoji", "Segoe UI Symbol",
22// 10. 絵文字 … Android … "Noto Color Emoji"
23$nn-sans-serif : -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, YuGothic, "Yu Gothic", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !default;
24// セリフ (明朝体)
25// 1. 英字 … Mac Win iOS Android … Georgia, (= Noto Serif on Android)
26// 2. 和英 … Mac Win … YuMincho, "Yu Mincho",
27// 3. 和英 … Mac iOS … "Hiragino Mincho ProN",
28// 4. 和英 … Win … "HGS明朝E",
29// 5. 全般 … … serif
30$nn-serif : Georgia, YuMincho, "Yu Mincho", "Hiragino Mincho ProN", "HGS明朝E", serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !default;
31// モノスペース (等幅)
32// 1. 和英 … Win [Mod] … MeiryoKe_Gothic,
33// 2. 和英 … Mac … Osaka-mono,
34// 3. 和英 … Win … "MS Gothic",
35// 4. 英字 … Mac Win iOS Android … "Courier New",
36// 5. 全般 … … monospace
37$nn-monospace : MeiryoKe_Gothic, Osaka-mono, "MS Gothic", "Courier New", monospace, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !default;
38
39
40/* ==================================================
41 * ページ全体
42 * ================================================== */
43
44/* Yu Gothic Medium : Windows Full Name → Windows PostScript Name */
45@font-face {
46 font-family: "Yu Gothic";
47 src: local("Yu Gothic Medium"), local("YuGothic-Medium");
48}
49
50@font-face {
51 font-family: "Yu Gothic";
52 src: local("Yu Gothic Bold"), local("YuGothic-Bold");
53 font-weight: bold;
54}
55
56/* 変数定義 */
57:root {
58 // SCSS 変数と同じ値にする
59 --nn-sans-serif: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, YuGothic, "Yu Gothic", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
60 --nn-serif: Georgia, YuMincho, "Yu Mincho", "Hiragino Mincho ProN", "HGS明朝E", serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
61 --nn-monospace: MeiryoKe_Gothic, Osaka-mono, "MS Gothic", "Courier New", monospace, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
62}
63
64/* 全ての要素のボックスサイズの計算方法を border-box にする */
65*,
66::before,
67::after {
68 box-sizing: border-box;
69}
70
71/* ページ全体のスタイルを設定する */
72html {
73 font-family: $nn-sans-serif;
74 /* 常に縦スクロールバーを表示する */
75 overflow-y: scroll;
76 cursor: default;
77 /* Chrome で下線部の文字切れを調整する */
78 text-decoration-skip-ink: none;
79 /* iOS でフォントサイズの調整を避ける */
80 -webkit-text-size-adjust: 100%;
81 /* iOS で下線部の文字切れを調整する */
82 -webkit-text-decoration-skip: objects;
83 /* iOS で慣性スクロールを有効にする */
84 -webkit-overflow-scrolling: touch;
85}
86
87/* ページの基準となるスタイルを設定する */
88body {
89 margin: 0;
90 line-height: 1.7;
91 overflow-wrap: break-word;
92 /* IE で overflow-wrap が効かないため指定する */
93 word-wrap: break-word;
94}
95
96/* IE でブロック要素として扱われない要素を設定しておく */
97details, main {
98 display: block;
99}
100
101
102/* ==================================================
103 * マージン関連
104 * ================================================== */
105
106/* 上下のマージンを設定する */
107h1, h2, h3, h4, h5, h6, p, hr, dl, dt, dd, ol, ul,
108address, details, blockquote, figure, figcaption, fieldset, form, pre, summary, table {
109 margin: 0 0 1rem;
110}
111
112/* 左マージンを追加する */
113dd, li, blockquote, figure {
114 margin-left: 2.5em;
115}
116
117/* 下マージンをなくす : 入れ子のリスト・子要素のマージンと親要素のパディングとの衝突回避 */
118ol ol, ol ul,
119ul ol, ul ul,
120blockquote > :last-child,
121fieldset > :last-child,
122pre > :last-child {
123 margin-bottom: 0;
124}
125
126/* リストの左パディングをなくす */
127ol, ul {
128 padding: 0;
129}
130
131
132/* ==================================================
133 * フォント関連
134 * ================================================== */
135
136/* 見出しサイズを調整する */
137h1 {
138 font-size: 2em;
139}
140
141h2 {
142 font-size: 1.7em;
143}
144
145h3 {
146 font-size: 1.5em;
147}
148
149h4 {
150 font-size: 1.2em;
151}
152
153/* 見出し5・6は通常サイズ・等幅フォントの要素は IE でフォントサイズが小さくなるのを直す */
154h5, h6,
155code, kbd, samp, var {
156 font-size: 1em;
157}
158
159/* 太字にする */
160caption, dt, em, th {
161 font-weight: bold;
162}
163
164/* 斜体にしない */
165address, dfn, em, var {
166 font-style: normal;
167}
168
169/* 等幅フォントにする */
170pre, code, kbd, samp, var, textarea {
171 font-family: $nn-monospace;
172}
173
174/* フォーム部品のフォントは親要素から継承させる */
175button, input, optgroup, select {
176 /* 要素の余白をなくす */
177 margin: 0;
178 font-family: inherit;
179 font-size: inherit;
180}
181
182/* テキストエリアはフォントサイズのみ親要素から継承させる */
183textarea {
184 margin: 0;
185 font-size: inherit;
186}
187
188/* 注釈のサイズを調整する */
189small {
190 font-size: .8em;
191}
192
193/* 下付き文字・上付き文字のサイズ・位置を調整する */
194sub, sup {
195 position: relative;
196 font-size: .75em;
197 vertical-align: baseline;
198}
199
200sub {
201 bottom: -.25em;
202}
203
204sup {
205 top: -.5em;
206}
207
208
209/* ==================================================
210 * 個別スタイル設定
211 * ================================================== */
212
213/* 引用ブロック */
214blockquote {
215 border: 1px solid $nn-green-border;
216 border-radius: 4px;
217 padding: 1em;
218 background: $nn-green-bg;
219}
220
221/* 等幅ブロック */
222pre {
223 border: 1px solid $nn-grey-border;
224 border-radius: 4px;
225 padding: 1em;
226 background: $nn-grey-bg;
227 overflow: auto;
228 overflow-wrap: normal;
229 /* IE・Edge 向け */
230 word-wrap: normal;
231 word-break: keep-all;
232 white-space: pre;
233}
234
235/* テーブル */
236table {
237 border-collapse: collapse;
238}
239
240/* テーブルセル */
241td, th {
242 border: 1px solid $nn-grey-border;
243 padding: .25em .5em;
244}
245
246/* テーブル見出し */
247th {
248 text-align: center;
249 background: $nn-grey-bg;
250}
251
252/* 水平線 */
253hr {
254 border: 0;
255 border-bottom: 1px solid $nn-grey-border;
256}
257
258/* フォームグループ */
259fieldset {
260 border: 1px solid $nn-grey-border;
261 border-radius: 4px;
262}
263
264/* 図表 */
265figure {
266 border-left: .5em solid $nn-grey-border;
267 padding-left: 1em;
268}
269
270/* 要約 */
271summary {
272 cursor: pointer;
273}
274
275/* 略語・定義 */
276abbr[title], dfn[title] {
277 /* IE・Edge 向け */
278 text-decoration: underline;
279 text-decoration: underline dotted;
280 cursor: help;
281}
282
283/* コード */
284:not(pre) > code,
285:not(pre) > samp,
286:not(pre) > kbd,
287:not(pre) > var {
288 margin: 0 .25em;
289 border: 1px solid $nn-grey-border;
290 border-radius: 4px;
291 padding: .1em .25em;
292 background: $nn-grey-bg;
293}
294
295/* 引用 */
296q {
297 quotes: "“" "”" "‘" "’";
298}
299
300q::before {
301 content: open-quote;
302}
303
304q::after {
305 content: close-quote;
306}
307
308/* 隣接するテキストを上揃えにする */
309button, input, select, textarea {
310 vertical-align: top;
311}
312
313/* チェックボックスとラジオボタンは隣接するテキストを垂直中央揃えにする */
314[type="checkbox"], [type="radio"] {
315 vertical-align: middle;
316}
317
318/* Mac でのボタン類の表示仕様を揃える */
319button, [type="button"], [type="reset"], [type="submit"] {
320 -webkit-appearance: button;
321}