lism-css 0.6.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -81,6 +81,11 @@ h6 {
81
81
  // text-decoration-thickness: var(--underline-thickness, 1px);
82
82
  }
83
83
 
84
+ // フォーカス要素
85
+ @include mixin.maybe_where(':focus-visible') {
86
+ outline-offset: var(--focus-offset, 0px);
87
+ }
88
+
84
89
  /* ----------------------------------------
85
90
  table
86
91
  ---------------------------------------- */
@@ -127,11 +132,16 @@ h6 {
127
132
  /* ----------------------------------------
128
133
  dialog
129
134
  ---------------------------------------- */
135
+ /* ダイアログ展開時のガタツキを防ぐ */
136
+ // html:has(:modal[open]) {
137
+ // scrollbar-gutter: stable;
138
+ // }
139
+
130
140
  // showModal()にのみ適用するため、 dialog ではなく :modal を使用
131
141
  @include mixin.switch_selector('body:has(:modal[open])', 'body:where(:has(:modal[open]))') {
132
142
  overflow: hidden;
133
143
  }
134
144
 
135
- @include mixin.switch_selector('dialog:not([open])', 'dialog:where(:not([open]))') {
136
- pointer-events: none;
137
- }
145
+ // @include mixin.switch_selector('dialog:not([open])', 'dialog:where(:not([open]))') {
146
+ // pointer-events: none;
147
+ // }
@@ -38,7 +38,7 @@
38
38
  --sz--s: 640px; // 80*8
39
39
  --sz--xs: 480px; // 80*6
40
40
 
41
- --sz--min: 16rem; // 最低限維持したいコンテンツサイズの標準値。 withSide等 で使用
41
+ --sz--min: 18rem; // 最低限維持したいコンテンツサイズの標準値。 withSide等 で使用
42
42
 
43
43
  // .l--flow の余白
44
44
  --flow--base: var(--s40);
@@ -50,12 +50,8 @@
50
50
  タイポグラフィ
51
51
  ------------------------------------------------------------ */
52
52
 
53
- // --ff--sans: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Meiryo', sans-serif;
54
- // --ff--serif: serif;
55
-
56
- --ff--base: -apple-system, 'BlinkMacSystemFont', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif, 'Segoe UI Emoji';
57
-
58
- // Optima, Georgia, Garamond, Baskerville;
53
+ // system-ui は 游ゴシックが適用されてしまう。-apple-system: safari, firefox用 / 'BlinkMacSystemFont': Chrome用
54
+ --ff--base: -apple-system, 'BlinkMacSystemFont', sans-serif, 'Segoe UI Emoji';
59
55
  --ff--accent: 'Garamond', 'Baskerville', 'Times New Roman', serif;
60
56
  --ff--mono: Menlo, Consolas, monaco, monospace;
61
57
 
@@ -10,5 +10,5 @@
10
10
  border: none;
11
11
  text-decoration: none;
12
12
  padding: 0;
13
- // margin: 0;
13
+ margin: 0;
14
14
  }
@@ -5,8 +5,10 @@
5
5
  $layer_mode: 0
6
6
  );
7
7
 
8
- // base
8
+ // reset(ここはレイヤーあり)
9
9
  @use './reset' as reset;
10
+
11
+ // base
10
12
  @use './base/index' as base;
11
13
 
12
14
  // Modules
@@ -1,33 +1,42 @@
1
- // dialog,
1
+ /*
2
+ * dialog で実装.
3
+ * Memo: ::backdrop のアニメーションはFirefoxで動かない
4
+ */
2
5
  .d--modal {
3
6
  --my-s: 0; // flow直下にきても影響しないように
4
- --offset: 0 0; // アニメーション用
5
7
  --duration: var(--modal-duration, 0.5s);
6
- --backdropBg: rgb(0 0 0 / 0.6);
8
+ width: 100%;
9
+ height: 100%;
7
10
  max-width: 100%;
8
11
  max-height: 100%;
9
- transition-duration: var(--duration, 0.5s);
12
+ overflow: unset;
13
+ background: var(--backdrop-bg, rgb(0 0 0 / 0.6));
14
+ transition-duration: var(--duration);
15
+ transition-property: opacity;
10
16
 
11
17
  &::backdrop {
12
- transition: opacity var(--duration, 0.5s);
13
- background: var(--backdropBg);
18
+ background: none;
14
19
  }
15
20
  }
21
+ .d--modal[open] {
22
+ display: flex;
23
+ flex-direction: column;
24
+ justify-content: center;
25
+ }
16
26
 
17
27
  .d--modal_inner {
18
- max-height: 100%;
28
+ --translate: 0 0; // アニメーション用
19
29
  background-color: var(--c--base);
30
+ transition: translate var(--duration);
20
31
  }
21
32
 
22
- .d--modal_body {
23
- overflow: auto;
24
- overscroll-behavior: contain;
25
- }
33
+ // .d--modal_body {
34
+ // overscroll-behavior: contain;
35
+ // }
26
36
 
27
37
  .d--modal:not([data-is-open]) {
28
- translate: var(--offset);
29
- }
30
- .d--modal:not([data-is-open]),
31
- .d--modal:not([data-is-open])::backdrop {
32
38
  opacity: 0;
33
39
  }
40
+ .d--modal:not([data-is-open]) > .d--modal_inner {
41
+ translate: var(--translate);
42
+ }
@@ -1,19 +1,15 @@
1
- /*
2
- Memo:
3
- - > * + * を使えば :first-child への my-s の打ち消しは不要になるが、 my-e 0 を :first-child にも効かせたいので、 > * で書いている。
4
- */
5
1
  .l--flow {
6
2
  display: flow-root;
7
3
  // --flow: var(--flow--base);
8
4
 
9
- > * {
5
+ > * + * {
10
6
  --flow: var(--flow--base);
11
7
  --my-s: var(--flow);
12
- margin-block: var(--my-s) 0;
8
+ margin-block-start: var(--my-s);
13
9
  }
14
10
 
15
11
  // flow 直下のメディア要素は block に初期リセット
16
- > :where(img, video, audio) {
12
+ > :where(img, video) {
17
13
  display: block;
18
14
  }
19
15
  }
@@ -36,7 +32,6 @@
36
32
 
37
33
  // Note: 打ち消しを最後に書く
38
34
  // .l--flow > :where(.-max-sz\:full + .-max-sz\:full),
39
- .l--flow > :first-child,
40
35
  .is--skipFlow + * {
41
36
  --my-s: 0px;
42
37
  }
@@ -1,9 +1,10 @@
1
1
  @use './_mixin' as mixin;
2
2
 
3
3
  /* 参考
4
- - https://github.com/necolas/normalize.css/blob/master/normalize.css
4
+
5
5
  - https://github.com/filipelinhares/ress/blob/master/ress.css
6
6
  - https://elad2412.github.io/the-new-css-reset/
7
+ - https://www.joshwcomeau.com/css/custom-css-reset/
7
8
  */
8
9
 
9
10
  /* ------------------------------------------------------------
@@ -13,84 +14,99 @@
13
14
  - padding は ブラウザ標準スタイルのまま
14
15
  - margin はすべて 0 にリセット
15
16
  ------------------------------------------------------------ */
16
- *,
17
- ::before,
18
- ::after {
19
- box-sizing: border-box;
20
- }
21
-
22
- * {
23
- margin: 0;
24
- }
25
-
26
- /* ------------------------------------------------------------
17
+ @layer lism-reset {
18
+ *,
19
+ ::before,
20
+ ::after {
21
+ box-sizing: border-box;
22
+ }
23
+
24
+ * {
25
+ margin: 0;
26
+ }
27
+
28
+ /* ------------------------------------------------------------
27
29
  Texts
28
30
  ------------------------------------------------------------ */
29
31
 
30
- /* テキストのオーバーフローを回避 */
31
- @include mixin.maybe_where('p, h1, h2, h3, h4, h5, h6') {
32
- overflow-wrap: break-word;
33
- }
34
-
35
- /* ルビのサイズ統一 */
36
- rt {
37
- font-size: 50%;
38
- }
39
-
40
- /* ------------------------------------------------------------
32
+ /* テキストのオーバーフローを回避 */
33
+ p,
34
+ h1,
35
+ h2,
36
+ h3,
37
+ h4,
38
+ h5,
39
+ h6 {
40
+ overflow-wrap: break-word;
41
+ }
42
+
43
+ /* ルビのサイズ統一 */
44
+ rt {
45
+ font-size: 50%;
46
+ }
47
+
48
+ /* ------------------------------------------------------------
41
49
  Medias
42
50
  ------------------------------------------------------------ */
43
51
 
44
- /* 親要素をはみ出さないようにする */
45
- @include mixin.maybe_where('img, video') {
46
- max-inline-size: 100%;
47
- block-size: auto;
48
- }
49
-
50
- /* 隙間ができるのを防ぐ。( display はいじらない。) */
51
- @include mixin.maybe_where('svg, img, video, audio') {
52
- vertical-align: middle;
53
- }
54
-
55
- /* iframe は display block */
56
- @include mixin.maybe_where('iframe, embed, object') {
57
- display: block;
58
- border: none;
59
- }
60
-
61
- /* ------------------------------------------------------------
52
+ /* 親要素をはみ出さないようにする */
53
+ img,
54
+ video {
55
+ max-inline-size: 100%;
56
+ block-size: auto;
57
+ }
58
+
59
+ /* 隙間ができるのを防ぐ。( display はいじらない。) */
60
+ svg,
61
+ img,
62
+ video,
63
+ audio {
64
+ vertical-align: middle;
65
+ }
66
+
67
+ /* iframe は display block */
68
+ iframe {
69
+ display: block;
70
+ border: none;
71
+ }
72
+
73
+ /* ------------------------------------------------------------
62
74
  Form fields
63
75
  - 基本要素のフォントとカラーをリセット
64
76
  - テキストエリアの水平リサイズを無効に
65
77
  - カーソルのセット
66
78
  ------------------------------------------------------------ */
67
- @include mixin.maybe_where('input, button, textarea, select') {
68
- font: inherit;
69
- color: inherit;
70
- text-transform: none;
71
- }
72
-
73
- /* テキストエリアの水平リサイズを無効に */
74
- textarea {
75
- resize: vertical;
76
- }
77
-
78
- /* ------------------------------------------------------------
79
+ input,
80
+ button,
81
+ textarea,
82
+ select {
83
+ font: inherit;
84
+ color: inherit;
85
+ text-transform: none;
86
+ }
87
+
88
+ /* テキストエリアの水平リサイズを無効に */
89
+ textarea {
90
+ resize: vertical;
91
+ }
92
+
93
+ /* ------------------------------------------------------------
79
94
  cursor 初期セット
80
95
  ------------------------------------------------------------ */
81
- // :where([type='button'], [type='reset'], [type='submit'], [type='radio'], [type='checkbox']),
82
- // :where([t[role='option'], [role='button'], [aria-controls]),
83
- button,
84
- label,
85
- select,
86
- summary {
87
- cursor: pointer;
88
- }
89
-
90
- :disabled {
91
- cursor: not-allowed;
92
- }
93
-
94
- [aria-busy='true'] {
95
- cursor: progress;
96
+ // :where([type='button'], [type='reset'], [type='submit']),
97
+ // :where([t[role='option'], [role='button'], [aria-controls]),
98
+ button,
99
+ label,
100
+ select,
101
+ summary,
102
+ [type='radio'],
103
+ [type='checkbox'] {
104
+ cursor: pointer;
105
+ }
106
+
107
+ :disabled {
108
+ cursor: not-allowed;
109
+ }
110
+
111
+ // [aria-busy='true'] {cursor: progress;}
96
112
  }