lism-css 0.9.3 → 0.10.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.
- package/README.md +5 -5
- package/bin/__build-css.cjs +54 -54
- package/bin/build-config.js +120 -120
- package/bin/build-css.js +52 -52
- package/bin/cli.mjs +33 -33
- package/config/__prop_list.js +42 -42
- package/config/__props.scss +20 -20
- package/config/default-config.ts +3 -3
- package/config/defaults/props.ts +326 -326
- package/config/defaults/states.ts +38 -38
- package/config/defaults/tokens.ts +25 -25
- package/config/helper/getSvgUrl.ts +16 -16
- package/config/helper/minifyHtml.ts +11 -11
- package/config/helper.test.ts +231 -231
- package/config/helper.ts +43 -49
- package/config/index.ts +4 -4
- package/config/tsconfig.json +16 -16
- package/dist/components/Box/Box.stories.d.ts +7 -0
- package/dist/components/Center/Center.stories.d.ts +8 -0
- package/dist/components/Cluster/Cluster.stories.d.ts +7 -0
- package/dist/components/Columns/Columns.stories.d.ts +8 -0
- package/dist/components/Container/Container.stories.d.ts +8 -0
- package/dist/components/Dummy/Dummy.d.ts +6 -9
- package/dist/components/Dummy/index.js +5 -10
- package/dist/components/Flex/Flex.stories.d.ts +9 -0
- package/dist/components/Flow/Flow.stories.d.ts +9 -0
- package/dist/components/FluidCols/FluidCols.stories.d.ts +7 -0
- package/dist/components/Frame/Frame.stories.d.ts +7 -0
- package/dist/components/Grid/Grid.stories.d.ts +8 -0
- package/dist/components/Group/Group.d.ts +3 -0
- package/dist/components/Group/index.d.ts +1 -0
- package/dist/components/Group/index.js +8 -0
- package/dist/components/HTML/HTML.d.ts +10 -0
- package/dist/components/Heading/Heading.d.ts +7 -0
- package/dist/components/Heading/index.d.ts +1 -0
- package/dist/components/Heading/index.js +9 -0
- package/dist/components/Inline/Inline.d.ts +3 -0
- package/dist/components/Inline/index.d.ts +1 -0
- package/dist/components/Inline/index.js +8 -0
- package/dist/components/Layer/Layer.d.ts +1 -2
- package/dist/components/Layer/Layer.stories.d.ts +8 -0
- package/dist/components/Layer/index.js +3 -4
- package/dist/components/Link/Link.d.ts +2 -0
- package/dist/components/Link/index.d.ts +1 -0
- package/dist/components/Link/index.js +8 -0
- package/dist/components/LinkBox/LinkBox.d.ts +3 -2
- package/dist/components/LinkBox/LinkBox.stories.d.ts +7 -0
- package/dist/components/LinkBox/index.js +5 -5
- package/dist/components/Lism/Lism.d.ts +10 -8
- package/dist/components/Lism/Lism.stories.d.ts +1 -650
- package/dist/components/List/List.d.ts +3 -0
- package/dist/components/List/ListItem.d.ts +3 -0
- package/dist/components/List/ListItem.js +8 -0
- package/dist/components/List/index.d.ts +2 -0
- package/dist/components/List/index.js +8 -0
- package/dist/components/SideMain/SideMain.stories.d.ts +9 -0
- package/dist/components/Stack/Stack.stories.d.ts +8 -0
- package/dist/components/SwitchCols/SwitchCols.stories.d.ts +9 -0
- package/dist/components/Text/Text.d.ts +3 -0
- package/dist/components/Text/index.d.ts +1 -0
- package/dist/components/Text/index.js +8 -0
- package/dist/components/Wrapper/Wrapper.stories.d.ts +10 -0
- package/dist/components/atomic/Decorator/Decorator.stories.d.ts +10 -0
- package/dist/components/atomic/Decorator/getProps.d.ts +5 -8
- package/dist/components/atomic/Decorator/getProps.js +10 -10
- package/dist/components/atomic/Divider/Divider.stories.d.ts +8 -0
- package/dist/components/atomic/Divider/getProps.d.ts +2 -2
- package/dist/components/atomic/Icon/Icon.d.ts +6 -2
- package/dist/components/atomic/Icon/Icon.stories.d.ts +15 -0
- package/dist/components/atomic/Icon/getProps.d.ts +11 -8
- package/dist/components/atomic/Icon/getProps.js +35 -34
- package/dist/components/atomic/Icon/index.d.ts +1 -0
- package/dist/components/atomic/Media/Media.d.ts +3 -2
- package/dist/components/atomic/Media/Media.stories.d.ts +8 -0
- package/dist/components/atomic/Media/index.js +4 -5
- package/dist/components/atomic/Spacer/Spacer.stories.d.ts +9 -0
- package/dist/components/atomic/Spacer/getProps.d.ts +2 -2
- package/dist/components/index.d.ts +8 -1
- package/dist/components/index.js +50 -36
- package/dist/config/helper.d.ts +1 -1
- package/dist/css/base.css +1 -1
- package/dist/css/main.css +1 -1
- package/dist/css/main_no_layer.css +1 -1
- package/dist/css/modules/atomic.css +1 -1
- package/dist/css/modules/layout.css +1 -1
- package/dist/lib/getLayoutProps.d.ts +4 -3
- package/dist/lib/getLismProps.d.ts +13 -11
- package/dist/lib/getLismProps.js +69 -73
- package/dist/lib/getMaybeCssVar.js +15 -10
- package/dist/lib/getMaybeTokenValue.d.ts +2 -2
- package/dist/lib/types/LayoutProps.d.ts +26 -26
- package/dist/lib/types.d.ts +2 -2
- package/package.json +17 -10
- package/packages/astro/Box/Box.astro +6 -5
- package/packages/astro/Center/Center.astro +7 -1
- package/packages/astro/Cluster/Cluster.astro +7 -1
- package/packages/astro/Columns/Columns.astro +7 -1
- package/packages/astro/Container/Container.astro +7 -3
- package/packages/astro/Decorator/Decorator.astro +10 -8
- package/packages/astro/Divider/Divider.astro +6 -6
- package/packages/astro/Dummy/Dummy.astro +9 -8
- package/packages/astro/Flex/Flex.astro +7 -1
- package/packages/astro/Flow/Flow.astro +8 -1
- package/packages/astro/FluidCols/FluidCols.astro +8 -1
- package/packages/astro/Frame/Frame.astro +7 -1
- package/packages/astro/Grid/Grid.astro +7 -1
- package/packages/astro/Group/Group.astro +11 -0
- package/packages/astro/Group/index.ts +1 -0
- package/packages/astro/HTML/_index_memo.js +7 -7
- package/packages/astro/HTML/a.astro +6 -1
- package/packages/astro/HTML/button.astro +6 -1
- package/packages/astro/HTML/div.astro +6 -1
- package/packages/astro/HTML/h.astro +7 -0
- package/packages/astro/HTML/img.astro +6 -1
- package/packages/astro/HTML/li.astro +6 -1
- package/packages/astro/HTML/ol.astro +6 -1
- package/packages/astro/HTML/p.astro +6 -1
- package/packages/astro/HTML/span.astro +6 -1
- package/packages/astro/HTML/ul.astro +6 -1
- package/packages/astro/Heading/Heading.astro +13 -0
- package/packages/astro/Heading/index.ts +1 -0
- package/packages/astro/Icon/Icon.astro +15 -17
- package/packages/astro/Icon/SVG.astro +16 -16
- package/packages/astro/Inline/Inline.astro +11 -0
- package/packages/astro/Inline/index.ts +1 -0
- package/packages/astro/Layer/Layer.astro +7 -4
- package/packages/astro/Link/Link.astro +10 -0
- package/packages/astro/Link/index.ts +1 -0
- package/packages/astro/LinkBox/LinkBox.astro +9 -8
- package/packages/astro/Lism/Lism.astro +6 -9
- package/packages/astro/List/List.astro +11 -0
- package/packages/astro/List/ListItem.astro +11 -0
- package/packages/astro/List/index.ts +2 -0
- package/packages/astro/Media/Media.astro +9 -8
- package/packages/astro/SideMain/SideMain.astro +8 -1
- package/packages/astro/Spacer/Spacer.astro +7 -6
- package/packages/astro/Stack/Stack.astro +7 -1
- package/packages/astro/SwitchCols/SwitchCols.astro +8 -1
- package/packages/astro/Text/Text.astro +11 -0
- package/packages/astro/Text/index.ts +1 -0
- package/packages/astro/Wrapper/Wrapper.astro +9 -1
- package/packages/astro/env.d.ts +10 -0
- package/packages/astro/{index.js → index.ts} +9 -0
- package/packages/astro/tsconfig.json +12 -0
- package/packages/astro/types.ts +19 -0
- package/src/scss/__memo/_lh-auto-all.scss +12 -12
- package/src/scss/__memo/_lh-auto-h.scss +17 -17
- package/src/scss/__memo/_lh-manual.scss +27 -27
- package/src/scss/_auto_output.scss +174 -174
- package/src/scss/_mixin.scss +32 -32
- package/src/scss/_prop-config.scss +850 -850
- package/src/scss/_query.scss +26 -26
- package/src/scss/_setting.scss +6 -6
- package/src/scss/_with_layer.scss +13 -13
- package/src/scss/base/_html.scss +47 -47
- package/src/scss/base/set/_bp.scss +8 -8
- package/src/scss/base/set/_cqUnit.scss +22 -22
- package/src/scss/base/set/_gutter.scss +1 -1
- package/src/scss/base/set/_hov.scss +10 -10
- package/src/scss/base/set/_innerRs.scss +1 -1
- package/src/scss/base/set/_plain.scss +15 -15
- package/src/scss/base/set/_transition.scss +2 -2
- package/src/scss/base/tokens/_property.scss +3 -3
- package/src/scss/base/tokens/_shadow.scss +12 -11
- package/src/scss/base/tokens/_tokens.scss +77 -77
- package/src/scss/base/tokens/_typography.scss +69 -69
- package/src/scss/main_no_layer.scss +1 -1
- package/src/scss/modules/atomic/_divider.scss +4 -4
- package/src/scss/modules/atomic/_icon.scss +4 -4
- package/src/scss/modules/atomic/_spacer.scss +2 -2
- package/src/scss/modules/atomic/index.scss +0 -1
- package/src/scss/modules/layout/_center.scss +3 -3
- package/src/scss/modules/layout/_cluster.scss +3 -3
- package/src/scss/modules/layout/_columns.scss +3 -3
- package/src/scss/modules/layout/_flex.scss +4 -4
- package/src/scss/modules/layout/_flow.scss +16 -16
- package/src/scss/modules/layout/_fluidCols.scss +4 -4
- package/src/scss/modules/layout/_frame.scss +8 -8
- package/src/scss/modules/layout/_grid.scss +9 -9
- package/src/scss/modules/layout/_sideMain.scss +12 -12
- package/src/scss/modules/layout/_stack.scss +2 -2
- package/src/scss/modules/layout/_switchCols.scss +5 -5
- package/src/scss/modules/state/_container.scss +4 -4
- package/src/scss/modules/state/_layer.scss +3 -3
- package/src/scss/modules/state/_linkbox.scss +9 -9
- package/src/scss/modules/state/_vertical.scss +3 -3
- package/src/scss/modules/state/_wrapper.scss +8 -8
- package/src/scss/props/_border.scss +18 -18
- package/src/scss/props/_hover.scss +26 -26
- package/src/scss/props/_lh.scss +6 -6
- package/src/scss/props/_size.scss +7 -7
- package/src/scss/reset.scss +137 -137
- package/src/scss/utility/_cbox.scss +10 -10
- package/src/scss/utility/_clipText.scss +2 -2
- package/src/scss/utility/_hidden.scss +9 -9
- package/src/scss/utility/_itemDivider.scss +7 -7
- package/src/scss/utility/_linkExpand.scss +9 -9
- package/src/scss/utility/_snap.scss +5 -5
- package/src/scss/utility/_trimHL.scss +11 -11
- package/dist/components/Dummy/getContent.d.ts +0 -13
- package/dist/components/Dummy/getContent.js +0 -10
- package/dist/components/Dummy/texts.d.ts +0 -22
- package/dist/components/Dummy/texts.js +0 -39
- package/dist/components/Layer/getProps.d.ts +0 -5
- package/dist/components/atomic/Media/getProps.d.ts +0 -9
- package/dist/components/atomic/Media/getProps.js +0 -8
- package/dist/components/getFilterProps.d.ts +0 -10
- package/dist/components/getFilterProps.js +0 -23
- package/dist/components/getFilterProps.test.d.ts +0 -1
- package/dist/components/setMaybeTransformStyles.d.ts +0 -12
- package/dist/components/setMaybeTransformStyles.js +0 -7
- package/dist/components/setMaybeTransformStyles.test.d.ts +0 -1
- package/packages/astro/OverlayLink/OverlayLink.astro +0 -10
- package/packages/astro/OverlayLink/index.js +0 -1
- package/packages/astro/helper.js +0 -6
- package/src/scss/modules/atomic/_media.scss +0 -3
- /package/packages/astro/Box/{index.js → index.ts} +0 -0
- /package/packages/astro/Center/{index.js → index.ts} +0 -0
- /package/packages/astro/Cluster/{index.js → index.ts} +0 -0
- /package/packages/astro/Columns/{index.js → index.ts} +0 -0
- /package/packages/astro/Container/{index.js → index.ts} +0 -0
- /package/packages/astro/Decorator/{index.js → index.ts} +0 -0
- /package/packages/astro/Divider/{index.js → index.ts} +0 -0
- /package/packages/astro/Dummy/{index.js → index.ts} +0 -0
- /package/packages/astro/Flex/{index.js → index.ts} +0 -0
- /package/packages/astro/Flow/{index.js → index.ts} +0 -0
- /package/packages/astro/FluidCols/{index.js → index.ts} +0 -0
- /package/packages/astro/Frame/{index.js → index.ts} +0 -0
- /package/packages/astro/Grid/{index.js → index.ts} +0 -0
- /package/packages/astro/HTML/{index.js → index.ts} +0 -0
- /package/packages/astro/Icon/{index.js → index.ts} +0 -0
- /package/packages/astro/Layer/{index.js → index.ts} +0 -0
- /package/packages/astro/LinkBox/{index.js → index.ts} +0 -0
- /package/packages/astro/Lism/{index.js → index.ts} +0 -0
- /package/packages/astro/Media/{index.js → index.ts} +0 -0
- /package/packages/astro/SideMain/{index.js → index.ts} +0 -0
- /package/packages/astro/Spacer/{index.js → index.ts} +0 -0
- /package/packages/astro/Stack/{index.js → index.ts} +0 -0
- /package/packages/astro/SwitchCols/{index.js → index.ts} +0 -0
- /package/packages/astro/Wrapper/{index.js → index.ts} +0 -0
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
+
import type { AstroLismBaseProps } from '../types';
|
|
3
4
|
import { Lism } from '../Lism';
|
|
4
|
-
// import getProps from '../../../dist/components/LinkBox/getProps';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
type Props<Tag extends HTMLTag = 'a'> = Polymorphic<{ as: Tag }> & AstroLismBaseProps;
|
|
7
|
+
|
|
8
|
+
const { as, exProps, ...props } = Astro.props;
|
|
8
9
|
|
|
9
10
|
const hasHref = !!props.href;
|
|
10
|
-
|
|
11
|
+
// LinkBoxは基本的にリンク要素(aタグ)として機能するため、
|
|
12
|
+
// hrefがないかつ、aタグとしてレンダリングする場合はdivタグに置き換える
|
|
13
|
+
const tag: HTMLTag = !hasHref && (as ?? 'a') === 'a' ? 'div' : (as ?? 'a');
|
|
11
14
|
---
|
|
12
15
|
|
|
13
|
-
<Lism isLinkBox as={tag} {...props}>
|
|
14
|
-
<slot />
|
|
15
|
-
</Lism>
|
|
16
|
+
<Lism isLinkBox as={tag} {...props} {...exProps}><slot /></Lism>
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
3
|
-
import
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
+
import type { AstroLismBaseProps } from '../types';
|
|
4
|
+
import getLismProps from 'lism-css/lib/getLismProps';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
interface Props extends LismProps {}
|
|
6
|
+
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismBaseProps;
|
|
7
7
|
|
|
8
|
-
const { as, exProps, ...props } = Astro.props
|
|
9
|
-
const JSX = as || 'div';
|
|
8
|
+
const { as: Tag = 'div', exProps, ...props } = Astro.props;
|
|
10
9
|
---
|
|
11
10
|
|
|
12
|
-
<
|
|
13
|
-
<slot />
|
|
14
|
-
</JSX>
|
|
11
|
+
<Tag {...getLismProps(props)} {...exProps}><slot /></Tag>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
+
import type { AstroLismBaseProps } from '../types';
|
|
4
|
+
import Lism from '../Lism/Lism.astro';
|
|
5
|
+
|
|
6
|
+
type Props<Tag extends HTMLTag = 'ul'> = Polymorphic<{ as: Tag }> & AstroLismBaseProps;
|
|
7
|
+
|
|
8
|
+
const { as: Tag = 'ul', ...props } = Astro.props;
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<Lism as={Tag} {...props}><slot /></Lism>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
+
import type { AstroLismBaseProps } from '../types';
|
|
4
|
+
import Lism from '../Lism/Lism.astro';
|
|
5
|
+
|
|
6
|
+
type Props<Tag extends HTMLTag = 'li'> = Polymorphic<{ as: Tag }> & AstroLismBaseProps;
|
|
7
|
+
|
|
8
|
+
const { as: Tag = 'li', ...props } = Astro.props;
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<Lism as={Tag} {...props}><slot /></Lism>
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
+
import type { AstroLismBaseProps } from '../types';
|
|
4
|
+
import getLismProps from 'lism-css/lib/getLismProps';
|
|
4
5
|
import { Image } from 'astro:assets';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
type Props<Tag extends HTMLTag = 'img'> = Polymorphic<{ as: Tag }> & AstroLismBaseProps;
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
const { as, exProps, ...props } = Astro.props;
|
|
10
|
+
|
|
11
|
+
let JSX: any = as || 'img';
|
|
9
12
|
if (JSX === 'AstroImage') {
|
|
10
|
-
|
|
13
|
+
JSX = Image;
|
|
11
14
|
}
|
|
12
15
|
---
|
|
13
16
|
|
|
14
|
-
<JSX {...getLismProps(
|
|
15
|
-
<slot />
|
|
16
|
-
</JSX>
|
|
17
|
+
<JSX {...getLismProps(props)} {...exProps}><slot /></JSX>
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
+
import type { AstroLismFixedLayoutProps } from '../types';
|
|
4
|
+
import type { SideMainProps } from 'lism-css/lib/types/LayoutProps';
|
|
2
5
|
import { Lism } from '../Lism';
|
|
6
|
+
|
|
7
|
+
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismFixedLayoutProps & Omit<SideMainProps, 'layout'>;
|
|
8
|
+
|
|
9
|
+
const props = Astro.props;
|
|
3
10
|
---
|
|
4
11
|
|
|
5
|
-
<Lism layout=
|
|
12
|
+
<Lism layout="sideMain" {...props}><slot /></Lism>
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
+
import type { AstroLismBaseProps } from '../types';
|
|
3
4
|
import { Lism } from '../Lism';
|
|
4
|
-
import getProps from '
|
|
5
|
+
import getProps from 'lism-css/react/atomic/Spacer/getProps';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const props = Astro.props
|
|
7
|
+
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismBaseProps;
|
|
8
|
+
|
|
9
|
+
const { as: Tag = 'div', exProps, ...props } = Astro.props;
|
|
9
10
|
---
|
|
10
11
|
|
|
11
|
-
<Lism {...getProps(props)} />
|
|
12
|
+
<Lism as={Tag} {...getProps(props)} {...exProps} />
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
+
import type { AstroLismFixedLayoutProps } from '../types';
|
|
2
4
|
import { Lism } from '../Lism';
|
|
5
|
+
|
|
6
|
+
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismFixedLayoutProps;
|
|
7
|
+
|
|
8
|
+
const props = Astro.props;
|
|
3
9
|
---
|
|
4
10
|
|
|
5
|
-
<Lism layout=
|
|
11
|
+
<Lism layout="stack" {...props}><slot /></Lism>
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
+
import type { AstroLismFixedLayoutProps } from '../types';
|
|
4
|
+
import type { SwitchColsProps } from 'lism-css/lib/types/LayoutProps';
|
|
2
5
|
import { Lism } from '../Lism';
|
|
6
|
+
|
|
7
|
+
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> & AstroLismFixedLayoutProps & Omit<SwitchColsProps, 'layout'>;
|
|
8
|
+
|
|
9
|
+
const props = Astro.props;
|
|
3
10
|
---
|
|
4
11
|
|
|
5
|
-
<Lism layout=
|
|
12
|
+
<Lism layout="switchCols" {...props}><slot /></Lism>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
+
import type { AstroLismBaseProps } from '../types';
|
|
4
|
+
import Lism from '../Lism/Lism.astro';
|
|
5
|
+
|
|
6
|
+
type Props<Tag extends HTMLTag = 'p'> = Polymorphic<{ as: Tag }> & AstroLismBaseProps;
|
|
7
|
+
|
|
8
|
+
const { as: Tag = 'p', ...props } = Astro.props;
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<Lism as={Tag} {...props}><slot /></Lism>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Text } from './Text.astro';
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
---
|
|
2
|
+
import type { HTMLTag, Polymorphic } from 'astro/types';
|
|
3
|
+
import type { AstroLismBaseProps } from '../types';
|
|
4
|
+
import type { LismProps } from 'lism-css/lib/getLismProps';
|
|
2
5
|
import { Lism } from '../Lism';
|
|
3
6
|
|
|
4
|
-
|
|
7
|
+
type Props<Tag extends HTMLTag = 'div'> = Polymorphic<{ as: Tag }> &
|
|
8
|
+
AstroLismBaseProps & {
|
|
9
|
+
contentSize?: LismProps['isWrapper'];
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const { contentSize = true, ...props } = Astro.props;
|
|
5
13
|
---
|
|
6
14
|
|
|
7
15
|
<Lism isWrapper={contentSize} {...props}><slot /></Lism>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="astro/client" />
|
|
2
|
+
|
|
3
|
+
declare module '*.astro' {
|
|
4
|
+
const component: (props: Record<string, unknown>) => unknown;
|
|
5
|
+
export default component;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
declare module 'astro:assets' {
|
|
9
|
+
export const Image: typeof import('astro/components/Image.astro').default;
|
|
10
|
+
}
|
|
@@ -4,7 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
export * from './Lism';
|
|
6
6
|
export { default as HTML } from './HTML';
|
|
7
|
+
/** @deprecated DummyText / DummyImage (@lism-css/ui) を使用してください */
|
|
7
8
|
export * from './Dummy';
|
|
9
|
+
|
|
10
|
+
// semantic wrappers
|
|
11
|
+
export * from './Text';
|
|
12
|
+
export * from './Inline';
|
|
13
|
+
export * from './Group';
|
|
14
|
+
export * from './Heading';
|
|
15
|
+
export * from './Link';
|
|
16
|
+
export * from './List';
|
|
8
17
|
export * from './Box';
|
|
9
18
|
export * from './Flow';
|
|
10
19
|
export * from './Flex';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "astro/tsconfigs/strict",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"allowJs": true,
|
|
5
|
+
"checkJs": false,
|
|
6
|
+
"moduleResolution": "bundler",
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"resolveJsonModule": true,
|
|
9
|
+
"skipLibCheck": true
|
|
10
|
+
},
|
|
11
|
+
"include": ["./**/*.astro", "./**/*.ts"]
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Astro 用の Lism Props 型
|
|
3
|
+
*
|
|
4
|
+
* @see https://github.com/withastro/roadmap/discussions/601
|
|
5
|
+
* @see https://github.com/withastro/roadmap/discussions/398
|
|
6
|
+
*/
|
|
7
|
+
import type { LismProps } from 'lism-css/lib/getLismProps';
|
|
8
|
+
import type { LayoutSpecificProps } from 'lism-css/lib/types/LayoutProps';
|
|
9
|
+
|
|
10
|
+
/** Polymorphic 型と組み合わせて使う共通ベース型 */
|
|
11
|
+
export type AstroLismBaseProps = LismProps &
|
|
12
|
+
LayoutSpecificProps & {
|
|
13
|
+
exProps?: Record<string, unknown>;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/** layout が固定されたレイアウトコンポーネント向けベース型 */
|
|
17
|
+
export type AstroLismFixedLayoutProps = Omit<LismProps, 'layout'> & {
|
|
18
|
+
exProps?: Record<string, unknown>;
|
|
19
|
+
};
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
→ 下限・上限を超える値がセットされている時、その値を継承できない。
|
|
5
5
|
*/
|
|
6
6
|
:root {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
--lh-min: 1.3em;
|
|
8
|
+
--lh-max: 1.9em;
|
|
9
9
|
}
|
|
10
10
|
// ---------------------------------------------------------------------
|
|
11
11
|
|
|
12
12
|
// 全要素で --fz, --lh を受け取れるように
|
|
13
13
|
:where(body *) {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
font-size: var(--fz, inherit);
|
|
15
|
+
line-height: var(--lh, inherit);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
// [style*="--fz:"]{
|
|
@@ -23,15 +23,15 @@
|
|
|
23
23
|
*:not([style*="font-size"]),
|
|
24
24
|
[style*="--fz:"], // --fzでフォントサイズ指定されているもの
|
|
25
25
|
[class*="-fz\:"], {
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
--slope: 0.35; // 自動計算用の傾き
|
|
27
|
+
--base: calc(var(--lh, var(--root--lh)) * 1em); // 計算ように単位をつけておく
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
// 上限値を var(--base) にすることで、フォントサイズが大きい場合にのみ計算を適用することも可能
|
|
30
|
+
line-height: clamp(
|
|
31
|
+
min(var(--lh-min), var(--base)),
|
|
32
|
+
calc((var(--slope) * 1em) + var(--base) - (var(--slope) * var(--fz, 1em))),
|
|
33
|
+
max(var(--lh-max), var(--base))
|
|
34
|
+
);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
// .-fz:などに対して--lh指定されてあった場合に上書きできる位置で
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
* タイポグラフィ
|
|
3
3
|
*/
|
|
4
4
|
:root {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
--lh-min: 1.3em;
|
|
6
|
+
--lh-max: 1.9em;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
// ---------------------------------------------------------------------
|
|
10
10
|
body {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
--fz: 1em; // 計算用に --fz の単位をem化しておく
|
|
12
|
+
--lh: var(--root--lh); // 任意の値
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
// :where(body *),
|
|
16
16
|
:where(:is(h1, h2, h3, h4, h5, h6, p)) {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
font-size: var(--fz, inherit);
|
|
18
|
+
line-height: var(--lh, inherit);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
// [style*="--fz:"]{
|
|
@@ -30,21 +30,21 @@ body {
|
|
|
30
30
|
[style*="--fz:"], // --fzでフォントサイズ指定されているもの
|
|
31
31
|
:where(:is(h1, h2, h3, h4, h5, h6, p)):not([style*="font-size"]),
|
|
32
32
|
[class*="-fz\:"] {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
--slope: 0.35; // 自動計算用の傾き
|
|
34
|
+
--base: calc(var(--lh) * 1em); // 計算ように単位をつけておく
|
|
35
|
+
|
|
36
|
+
// 上限値を var(--base) にすることで、フォントサイズが大きい場合にのみ計算を適用することも可能
|
|
37
|
+
line-height: clamp(
|
|
38
|
+
min(var(--lh-min), var(--base)),
|
|
39
|
+
calc((var(--slope) * 1em) + var(--base) - (var(--slope) * var(--fz))),
|
|
40
|
+
max(var(--lh-max), var(--base))
|
|
41
|
+
);
|
|
42
|
+
font-size: var(--fz);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
// --lh指定されている要素自身はその値で上書き。→ .-lh: 使ってもらう?
|
|
46
46
|
[style*='--lh:'] {
|
|
47
|
-
|
|
47
|
+
line-height: var(--lh);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
// ---------------------------------------------------------------------
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
// 各fzサイズ用のline-height
|
|
3
|
+
--ls--6L--lh: 1.2;
|
|
4
|
+
--ls--5L--lh: 1.4;
|
|
5
|
+
--ls--4L--lh: 1.4;
|
|
6
|
+
--ls--3L--lh: 1.5;
|
|
7
|
+
--ls--2L--lh: 1.6;
|
|
8
|
+
--ls--L--lh: 1.6;
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
// 1,
|
|
11
|
+
// 1.25, 5XL
|
|
12
|
+
// 1.4 4XL
|
|
13
|
+
// 1.5, 2XL, 3XL,
|
|
14
|
+
// 1.6, L XL
|
|
15
|
+
// 1.75 base
|
|
16
|
+
// 2,
|
|
17
|
+
// 2.5
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
// 1, xs sm md, lg xl
|
|
20
|
+
// 1, 1.25, 1.5. 1.75, 2, 2.5
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
h1 {
|
|
24
|
-
|
|
24
|
+
--lh: var(--ls--4L--lh);
|
|
25
25
|
}
|
|
26
26
|
h2 {
|
|
27
|
-
|
|
27
|
+
--lh: var(--ls--3L--lh);
|
|
28
28
|
}
|
|
29
29
|
h3 {
|
|
30
|
-
|
|
30
|
+
--lh: var(--ls--2L--lh);
|
|
31
31
|
}
|
|
32
32
|
h4 {
|
|
33
|
-
|
|
33
|
+
--lh: var(--ls--L--lh);
|
|
34
34
|
}
|
|
35
35
|
// h5 {}
|
|
36
36
|
// h6 {}
|
|
@@ -39,20 +39,20 @@ h4 {
|
|
|
39
39
|
// .-fz\:s {}
|
|
40
40
|
// .-fz\:m {}
|
|
41
41
|
.-fz\:l {
|
|
42
|
-
|
|
42
|
+
--lh: var(--ls--L--lh);
|
|
43
43
|
}
|
|
44
44
|
.-fz\:xl {
|
|
45
|
-
|
|
45
|
+
--lh: var(--ls--2L--lh);
|
|
46
46
|
}
|
|
47
47
|
.-fz\:2xl {
|
|
48
|
-
|
|
48
|
+
--lh: var(--ls--3L--lh);
|
|
49
49
|
}
|
|
50
50
|
.-fz\:3xl {
|
|
51
|
-
|
|
51
|
+
--lh: var(--ls--4L--lh);
|
|
52
52
|
}
|
|
53
53
|
.-fz\:4xl {
|
|
54
|
-
|
|
54
|
+
--lh: var(--ls--5L--lh);
|
|
55
55
|
}
|
|
56
56
|
.-fz\:5xl {
|
|
57
|
-
|
|
57
|
+
--lh: var(--ls--6L--lh);
|
|
58
58
|
}
|