From a2c37728bb6e1fa7ff6222bce866c5e4fb0f9711 Mon Sep 17 00:00:00 2001 From: wangshuainan1 Date: Wed, 30 Mar 2022 20:30:55 +0800 Subject: [PATCH] =?UTF-8?q?3.30docs=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangshuainan1 --- .../figures/zh-cn_image_0000001263259399.png | Bin 4368 -> 4039 bytes ...image_0000001263259399.png:Zone.Identifier | 4 + .../ui/ui-js-animate-component.md | 25 ++- .../ui/ui-js-animate-dynamic-effects.md | 11 +- .../ui/ui-js-animate-transform.md | 4 + .../ui/ui-js-component-tabs.md | 6 +- .../ui/ui-js-components-button.md | 6 + .../ui/ui-js-components-canvas.md | 35 +++- ...-js-components-canvasrenderingcontext2d.md | 19 +- .../ui/ui-js-components-dialog.md | 6 +- .../ui/ui-js-components-form.md | 56 +++-- .../ui/ui-js-components-images.md | 26 ++- .../ui/ui-js-components-input.md | 6 + .../ui/ui-js-components-list.md | 6 +- .../ui/ui-js-components-menu.md | 17 +- .../ui/ui-js-components-picker.md | 8 + .../ui/ui-js-components-slider.md | 4 +- .../ui/ui-js-components-stepper.md | 17 +- .../ui/ui-js-components-swiper.md | 23 +- .../ui/ui-js-components-switch.md | 6 +- .../ui/ui-js-components-text.md | 197 ++++++++---------- .../ui/ui-js-components-toolbar.md | 13 +- .../ui/ui-ts-layout-grid-container.md | 20 +- 23 files changed, 342 insertions(+), 173 deletions(-) create mode 100644 zh-cn/application-dev/ui/figures/zh-cn_image_0000001263259399.png:Zone.Identifier diff --git a/zh-cn/application-dev/ui/figures/zh-cn_image_0000001263259399.png b/zh-cn/application-dev/ui/figures/zh-cn_image_0000001263259399.png index c9e2e084909884daa701f5e967050c849c036e5a..dc4a266c02708116362da21577d5b1e582a011fd 100644 GIT binary patch literal 4039 zcmeHK={pn(7ax(iS<*DhZIHUc%~+C|!B|4mXt9++)<`jADJKMiY?X@nIfDXeGmLguf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3W+3eeD2-H1p%kRxs#nfw zm$oF|;T#tJ`*8Td-a!EW@u=T=M91s9bb_`q#b>b;2QQE>E{|Ml9K1OCPzUXo9jjo_ z#b5rCMjSg+!eP>LC(EC@=Y~NE}N_A(^Ud`EW=#uB2Bjk^B`NdDk|`noj%3P)z{4J=0jQ zk^#Uhawd94t64q#weApvo`F}-bzMl`s`LcqT9aNeK$>d0r~;%#;6DJ)sovoL diff --git a/zh-cn/application-dev/ui/figures/zh-cn_image_0000001263259399.png:Zone.Identifier b/zh-cn/application-dev/ui/figures/zh-cn_image_0000001263259399.png:Zone.Identifier new file mode 100644 index 0000000000..5014c60c73 --- /dev/null +++ b/zh-cn/application-dev/ui/figures/zh-cn_image_0000001263259399.png:Zone.Identifier @@ -0,0 +1,4 @@ +[ZoneTransfer] +ZoneId=3 +ReferrerUrl=https://gitee.com/openharmony/docs/pulls/2845/files +HostUrl=https://gitee.com/openharmony/docs/raw/32dae5064fb2c1d43eb8a383be7af76c9d8c4d44/zh-cn/application-dev/ui/figures/zh-cn_image_0000001263259399.png diff --git a/zh-cn/application-dev/ui/ui-js-animate-component.md b/zh-cn/application-dev/ui/ui-js-animate-component.md index 674d3c3b9c..91baf79e19 100644 --- a/zh-cn/application-dev/ui/ui-js-animate-component.md +++ b/zh-cn/application-dev/ui/ui-js-animate-component.md @@ -104,7 +104,30 @@ export default { this.options = { duration: 4000, }; - this.keyframes = [ { transform: { translate: '-120px -0px', scale: 1, rotate: 0 }, transformOrigin: '100px 100px', offset: 0.0, width: 200, height: 200 }, { transform: { translate: '120px 0px', scale: 1.5, rotate: 90 }, transformOrigin: '100px 100px', offset: 1.0, width: 300, height: 300 } ]; + this.keyframes = [ + { + transform: { + translate: '-120px -0px', + scale: 1, + rotate: 0 + }, + transformOrigin: '100px 100px', + offset: 0.0, + width: 200, + height: 200 + }, + { + transform: { + translate: '120px 0px', + scale: 1.5, + rotate: 90 + }, + transformOrigin: '100px 100px', + offset: 1.0, + width: 300, + height: 300 + } + ]; }, Show() { this.animation = this.$element('content').animate(this.keyframes, this.options); diff --git a/zh-cn/application-dev/ui/ui-js-animate-dynamic-effects.md b/zh-cn/application-dev/ui/ui-js-animate-dynamic-effects.md index b4d2bf487d..b5b8a275fc 100644 --- a/zh-cn/application-dev/ui/ui-js-animate-dynamic-effects.md +++ b/zh-cn/application-dev/ui/ui-js-animate-dynamic-effects.md @@ -25,6 +25,8 @@ ``` /* xxx.css */ .container { + width:100%; + height:100%; flex-direction: column; align-items: center; justify-content: center; @@ -90,7 +92,7 @@ animator支持事件和接口,可以通过添加frame、cancel、repeat、fini ``` -
+
-
+
this is a dialog
@@ -20,6 +20,8 @@ Dialog组件用于创建自定义弹窗,通常用来展示用户当前需要 ``` /* xxx.css */ .doc-page { + width:100%; + height:100%; flex-direction: column; align-items: center; justify-content: center; @@ -83,6 +85,8 @@ export default { ``` /* xxx.css */ .doc-page { + width:100%; + height:100%; flex-direction: column; align-items: center; justify-content: center; diff --git a/zh-cn/application-dev/ui/ui-js-components-form.md b/zh-cn/application-dev/ui/ui-js-components-form.md index 6c84b63958..43eb0538f1 100644 --- a/zh-cn/application-dev/ui/ui-js-components-form.md +++ b/zh-cn/application-dev/ui/ui-js-components-form.md @@ -13,7 +13,8 @@ Form是一个表单容器,支持容器内[Input](../reference/arkui-js/js-comp ```
-
+ +
``` @@ -21,6 +22,8 @@ Form是一个表单容器,支持容器内[Input](../reference/arkui-js/js-comp ``` /* xxx.css */ .container { + width:100%; + height:100%; flex-direction: column; justify-content: center; align-items: center; @@ -59,9 +62,8 @@ Form是一个表单容器,支持容器内[Input](../reference/arkui-js/js-comp background-color: #F1F3F5; } .formClass{ - width: 80%; - padding: 10px; - border: 1px solid #c3d3e7; + width: 100%; + height: 20%; } ``` @@ -72,26 +74,46 @@ Form是一个表单容器,支持容器内[Input](../reference/arkui-js/js-comp ## 添加响应事件 为Form组件添加submit和reset事件,来提交表单内容或重置表单选项。 + ``` -
-
-
-
- - - - -
-
- - -
+
+ +
+ + + + +
+
+ + + +
``` +``` +/* index.css */ +.container{ + width: 100%; + height: 100%; + flex-direction: column; + justify-items: center + align-items: center; + background-color: #F1F3F5; +} +.form{ + width: 100%; + height: 30%; + flex-direction: column; + justify-items: center + align-items: center; +} +``` + ``` /* xxx.js */ import prompt from '@system.prompt'; diff --git a/zh-cn/application-dev/ui/ui-js-components-images.md b/zh-cn/application-dev/ui/ui-js-components-images.md index f683371925..10a8f05bdc 100644 --- a/zh-cn/application-dev/ui/ui-js-components-images.md +++ b/zh-cn/application-dev/ui/ui-js-components-images.md @@ -9,13 +9,15 @@ Image是图片组件,用来渲染展示图片。具体用法请参考[Image AP ```
- +
``` ``` /* xxx.css */ .container { + width: 100%; + height: 100%; flex-direction: column; justify-content: center; align-items: center; @@ -45,15 +47,15 @@ Image是图片组件,用来渲染展示图片。具体用法请参考[Image AP flex-direction: column; align-items: center; justify-content: center; -background-color:#F1F3F5; + background-color:#F1F3F5; } image{ - width: 80%; height: 500px; + width: 80%; + height: 500px; border: 5px solid saddlebrown; border-radius: 20px; object-fit: contain; match-text-direction:true; - } ``` @@ -69,10 +71,13 @@ image{
- -
- image{{$idx}} - content +
+ + +
+ image{{$idx}} + content +
@@ -235,7 +240,10 @@ export default { justify-content: space-between; } .testimage { - width: 100%; height: 400px; object-fit: scale-down; border-radius: 20px;} + width: 100%; height: 400px; + object-fit: scale-down; + border-radius: 20px; +} ``` ``` diff --git a/zh-cn/application-dev/ui/ui-js-components-input.md b/zh-cn/application-dev/ui/ui-js-components-input.md index b37afa8a94..b8afcf6a8a 100644 --- a/zh-cn/application-dev/ui/ui-js-components-input.md +++ b/zh-cn/application-dev/ui/ui-js-components-input.md @@ -17,6 +17,8 @@ Input是交互式组件,用于接收用户数据。其类型可设置为日期 ``` /* xxx.css */ .container { + width: 100%; + height: 100%; flex-direction: column; justify-content: center; align-items: center; @@ -54,6 +56,8 @@ Input是交互式组件,用于接收用户数据。其类型可设置为日期 ``` /* xxx.css */ .container { + width: 100%; + height: 100%; align-items: center; flex-direction: column; justify-content: center; @@ -120,6 +124,7 @@ export default { /* xxx.css */ .content { width: 100%; + height: 100%; flex-direction: column; align-items: center; justify-content: center; @@ -176,6 +181,7 @@ export default { /* xxx.css */ .content { width: 100%; + height: 100%; flex-direction: column; align-items: center; justify-content: center; diff --git a/zh-cn/application-dev/ui/ui-js-components-list.md b/zh-cn/application-dev/ui/ui-js-components-list.md index c0bc55579a..45287a5231 100644 --- a/zh-cn/application-dev/ui/ui-js-components-list.md +++ b/zh-cn/application-dev/ui/ui-js-components-list.md @@ -10,7 +10,8 @@ List是用来显示列表的组件,包含一系列相同宽度的列表项, ```
- + + @@ -21,6 +22,8 @@ List是用来显示列表的组件,包含一系列相同宽度的列表项, ``` /* xxx.css */ .container { + width:100%; + height:100%; flex-direction: column; align-items: center; background-color: #F1F3F5; @@ -191,6 +194,7 @@ export default { ![zh-cn_image_0000001162911958](figures/zh-cn_image_0000001162911958.gif) > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** +> > - groupcollapse和groupexpand事件仅支持list-item-group组件使用。 diff --git a/zh-cn/application-dev/ui/ui-js-components-menu.md b/zh-cn/application-dev/ui/ui-js-components-menu.md index d364094b02..0ea286c5d0 100644 --- a/zh-cn/application-dev/ui/ui-js-components-menu.md +++ b/zh-cn/application-dev/ui/ui-js-components-menu.md @@ -25,6 +25,8 @@ ``` /* xxx.css */ .container{ + width: 100%; + height: 100%; flex-direction: column; background-color: #F1F3F5; align-items: center; @@ -65,6 +67,8 @@ ``` /* xxx.css */ .container{ + width: 100%; + height: 100%; flex-direction: column; background-color: #F1F3F5; align-items: center; @@ -115,6 +119,8 @@ option{ ``` /* xxx.css */ .container{ + width: 100%; + height: 100%; flex-direction: column; background-color: #F1F3F5; width: 100%; @@ -254,7 +260,16 @@ export default { {name: "black", checked:false}, ], }, - toggleClick(index){ for(let i=0;i ``` - - ``` /* xxx.css */ .container { @@ -119,6 +117,8 @@ Slider组件通过color、selected-color、block-color样式分别为滑动条 ``` /* xxx.css */ .container { + width: 100%; + height: 100%; flex-direction: column; justify-content: center; align-items: center; diff --git a/zh-cn/application-dev/ui/ui-js-components-stepper.md b/zh-cn/application-dev/ui/ui-js-components-stepper.md index 22479506c1..15c8e42a4a 100644 --- a/zh-cn/application-dev/ui/ui-js-components-stepper.md +++ b/zh-cn/application-dev/ui/ui-js-components-stepper.md @@ -14,7 +14,8 @@ ```
- + + Step 1 @@ -27,6 +28,8 @@ ``` /* xxx.css */ .container { + width:100%; + height:100%; flex-direction: column; justify-content: center; align-items: center; @@ -66,6 +69,8 @@ text{ ``` /* index.css */ .container { + width:100%; + height:100%; flex-direction: column; background-color:#F1F3F5; } @@ -102,7 +107,9 @@ text{ ``` /* index.css */ -.container { +.container { + width:100%; + height:100%; flex-direction: column; background-color:#F1F3F5; } @@ -154,6 +161,8 @@ Stepper组件默认填充父容器,通过border和background-color设置边框 ``` /* index.css */ .container { + width:100%; + height:100%; flex-direction: column; align-items: center; justify-content: center; @@ -208,6 +217,8 @@ Stepper分别添加finish,change,next,back,skip事件。 ``` /* xxx.css */ .doc-page { + width:100%; + height:100%; flex-direction: column; align-items: center; justify-content: center; @@ -325,6 +336,8 @@ export default { ``` /* xxx.css */ .container { + width:100%; + height:100%; flex-direction: column; align-items: center; justify-content: center; diff --git a/zh-cn/application-dev/ui/ui-js-components-swiper.md b/zh-cn/application-dev/ui/ui-js-components-swiper.md index de6c56907c..de9f3aa008 100644 --- a/zh-cn/application-dev/ui/ui-js-components-swiper.md +++ b/zh-cn/application-dev/ui/ui-js-components-swiper.md @@ -28,18 +28,24 @@ Swiper为滑动容器,提供切换显示子组件的能力。具体用法请 ``` /* xxx.css */ .container{ + width: 100%; + height: 100%; flex-direction: column; background-color: #F1F3F5; align-items: center; justify-content: center; width: 100%; } +swiper{ + height: 30%; +} .item{ width: 100%; height: 500px; } text{ width: 100%; + height: 100%; text-align: center; font-size: 50px; color: white; @@ -84,11 +90,15 @@ Swiper组件当不开启循环播放(loop="false")时添加自动播放属 ``` /* xxx.css */ .container{ + width: 100%; + height: 100%; flex-direction: column; background-color: #F1F3F5; align-items: center; justify-content: center; - width: 100%; +} +swiper{ + height: 30%; } .item{ width: 100%; @@ -96,6 +106,7 @@ Swiper组件当不开启循环播放(loop="false")时添加自动播放属 } text{ width: 100%; + height: 100%; text-align: center; font-size: 50px; color: white; @@ -138,11 +149,12 @@ text{ ``` /* xxx.css */ .container{ + width: 100%; + height: 100%; flex-direction: column; background-color: #F1F3F5; align-items: center; justify-content: center; - width: 100%; } swiper{ width: 500px; @@ -205,11 +217,15 @@ text{ ``` /* xxx.css */ .container{ + width: 100%; + height: 100%; flex-direction: column; background-color: #F1F3F5; align-items: center; justify-content: center; - width: 100%; +} +swiper{ + height: 30%; } .item{ width: 100%; @@ -217,6 +233,7 @@ text{ } text{ width: 100%; + height: 100%; text-align: center; font-size: 50px; color: white; diff --git a/zh-cn/application-dev/ui/ui-js-components-switch.md b/zh-cn/application-dev/ui/ui-js-components-switch.md index 4991f8587a..aa7e7e71cb 100644 --- a/zh-cn/application-dev/ui/ui-js-components-switch.md +++ b/zh-cn/application-dev/ui/ui-js-components-switch.md @@ -44,6 +44,8 @@ Switch为开关选择器,切换开启或关闭状态。具体用法请参考[S ``` /* xxx.css */ .container { + width: 100%; + height: 100%; display: flex; justify-content: center; align-items: center; @@ -53,7 +55,7 @@ switch{ // 选中时的字体颜色 texton-color: #002aff; // 未选中时的字体颜色 -textoff-color: silver; + textoff-color: silver; text-padding: 20px; font-size: 50px; } @@ -114,6 +116,8 @@ export default { ``` /* xxx.css */ .container { + width: 100%; + height: 100%; background-color: #F1F3F5; flex-direction: column; padding: 50px; diff --git a/zh-cn/application-dev/ui/ui-js-components-text.md b/zh-cn/application-dev/ui/ui-js-components-text.md index 96dfb5a196..b6b79dffe3 100644 --- a/zh-cn/application-dev/ui/ui-js-components-text.md +++ b/zh-cn/application-dev/ui/ui-js-components-text.md @@ -34,45 +34,41 @@ Text是文本组件,用于呈现一段文本信息。具体用法请参考[Tex - 添加文本样式 - 设置color、font-size、allow-scale、word-spacing、text-valign属性分别为文本添加颜色、大小、缩放、文本之间的间距和文本在垂直方向的对齐方式。 - - - ``` - -
- - This is a passage - - - This is a passage - -
- ``` - - - ``` - /* xxx.css */ - .container { - width: 100%; - height: 100%; - flex-direction: column; - align-items: center; - justify-content: center; - background-color: #F1F3F5; - } - ``` - - - ![zh-cn_image_0000001220778205](figures/zh-cn_image_0000001220778205.png) + 设置color、font-size、allow-scale、word-spacing、text-valign属性分别为文本添加颜色、大小、缩放、文本之间的间距和文本在垂直方向的对齐方式。 + +``` + +
+ + This is a passage + + + This is a passage + +
+``` + +``` +/* xxx.css */ +.container { + width: 100%; + height: 100%; + flex-direction: column; + align-items: center; + justify-content: center; + background-color: #F1F3F5; +} +``` + + + ![zh-cn_image_0000001220778205](figures/zh-cn_image_0000001220778205.png) - 添加划线 +​ 设置text-decoration和text-decoration-colo属性为文本添加划线和划线颜色,text-decoration枚举值请参考 Text自有样式。 + - 设置text-decoration和text-decoration-colo属性为文本添加划线和划线颜色,text-decoration枚举值请参考Text自有样式。 - - - ```
@@ -80,46 +76,38 @@ Text是文本组件,用于呈现一段文本信息。具体用法请参考[Tex This is a passage - +
- ``` - - - ``` - /* xxx.css */ - .container { - width: 100%; - height: 100%; - flex-direction: column; - align-items: center; - justify-content: center; - } - text{ - font-size: 50px; - } - ``` - - - ![zh-cn_image_0000001220856725](figures/zh-cn_image_0000001220856725.png) +``` +/* xxx.css */ +.container { + width: 100%; + height: 100%; + flex-direction: column; + align-items: center; + justify-content: center; +} +text{ + font-size: 50px; +} +``` + + ![zh-cn_image_0000001220856725](figures/zh-cn_image_0000001220856725.png) - 隐藏文本内容 + 当文本内容过多而显示不全时,添加text-overflow属性将隐藏内容以省略号的形式展现 + +``` + +
+ + This is a passage + +
+``` - 当文本内容过多而显示不全时,添加text-overflow属性将隐藏内容以省略号的形式展现。 - - - ``` - -
- - This is a passage - -
- ``` - - - ``` /* xxx.css */ .container { width: 100%; @@ -127,47 +115,42 @@ Text是文本组件,用于呈现一段文本信息。具体用法请参考[Tex flex-direction: column; align-items: center; background-color: #F1F3F5; - justify-content: center; + justify-content: center; } .text{ width: 200px; max-lines: 1; text-overflow:ellipsis; } - ``` - - - > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** - > - text-overflow样式需要与max-lines样式配套使用,设置了最大行数的情况下生效。 - > - > - max-lines属性设置文本最多可以展示的行数。 - - - ![zh-cn_image_0000001163656706](figures/zh-cn_image_0000001163656706.png) + + **说明:** + +- text-overflow样式需要与max-lines样式配套使用,设置了最大行数的情况下生效。 +- max-lines属性设置文本最多可以展示的行数。 + + +​ ![zh-cn_image_0000001163656706](figures/zh-cn_image_0000001163656706.png) - 设置文本折行 +​ 设置word-break属性对文本内容做断行处理,word-break枚举值请参考Text自有样式。 + +``` + +
+
+ + Welcome to the world + + + Welcome to the world + +
+
-
-
- - Welcome to the world - - - Welcome to the world - -
-
- ``` - - - ``` /* xxx.css */ .container { background-color: #F1F3F5; @@ -196,23 +179,25 @@ Text是文本组件,用于呈现一段文本信息。具体用法请参考[Tex word-break: break-all; font-size: 40px; } - ``` - - - ![zh-cn_image_0000001209033195](figures/zh-cn_image_0000001209033195.png) + + +​ ![zh-cn_image_0000001209033195](figures/zh-cn_image_0000001209033195.png) - Text组件支持[Span](../reference/arkui-js/js-components-basic-span.md)子组件 - + ``` -
+
This is a passage - This 1 is a 1 passage + This 1 + + is a 1 + passage
``` @@ -253,6 +238,8 @@ Text组件通过数据绑定展示文本内容,Span组件通过设置show属 ``` /* xxx.css */ .container { + width: 100%; + height: 100%; align-items: center; flex-direction: column; justify-content: center; diff --git a/zh-cn/application-dev/ui/ui-js-components-toolbar.md b/zh-cn/application-dev/ui/ui-js-components-toolbar.md index cfbe78bf94..09f8c17ff0 100644 --- a/zh-cn/application-dev/ui/ui-js-components-toolbar.md +++ b/zh-cn/application-dev/ui/ui-js-components-toolbar.md @@ -23,6 +23,8 @@ Toolbar为页面工具栏组件,用于展示针对当前界面的操作选项 ``` /* xxx.css */ .container { + width: 100%; + height: 100%; flex-direction: column; justify-content: center; align-items: center; @@ -44,7 +46,12 @@ toolbar-item{
- + + + + + +
``` @@ -53,6 +60,8 @@ toolbar-item{ ``` /* xxx.css */ .container { + width: 100%; + height: 100%; flex-direction: column; justify-content: center; align-items: center; @@ -92,6 +101,7 @@ toolbar-item{ background-color: #F1F3F5; flex-direction: column; width: 100%; + height: 100%; justify-content: center; align-items: center; } @@ -131,6 +141,7 @@ toolbar-item{ background-color: #F1F3F5; flex-direction: column; width: 100%; + height: 100%; justify-content: center; align-items: center; } diff --git a/zh-cn/application-dev/ui/ui-ts-layout-grid-container.md b/zh-cn/application-dev/ui/ui-ts-layout-grid-container.md index 23a040c516..df9383f16b 100644 --- a/zh-cn/application-dev/ui/ui-ts-layout-grid-container.md +++ b/zh-cn/application-dev/ui/ui-ts-layout-grid-container.md @@ -108,8 +108,8 @@ GridContainer() { struct GridContainerExample { build() { Column({ space: 5 }) { - GridContainer({ columns: 6, sizeType: SizeType.Auto, gutter: 10, margin: 20 }) { - Row() { + GridContainer({ columns: 6 }) { + Flex({justifyContent:FlexAlign.SpaceAround}) { Text('1') .useSizeType({ xs: { span: 2, offset: 0 }, @@ -120,18 +120,18 @@ struct GridContainerExample { .height(100).backgroundColor(0x4682B4).textAlign(TextAlign.Center) Text('2') .useSizeType({ - xs: { span: 2, offset: 2 }, - sm: { span: 2, offset: 2 }, - md: { span: 4, offset: 1 }, - lg: { span: 4, offset: 1 }, + xs: { span: 2, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 4, offset: 0 }, + lg: { span: 4, offset: 0 }, }) .height(100).backgroundColor(0x46F2B4).textAlign(TextAlign.Center) Text('3') .useSizeType({ - xs: { span: 2, offset: 4 }, - sm: { span: 2, offset: 4 }, - md: { span: 1, offset: 5 }, - lg: { span: 1, offset: 5 }, + xs: { span: 2, offset: 0 }, + sm: { span: 2, offset: 0 }, + md: { span: 1, offset: 0 }, + lg: { span: 1, offset: 0 }, }) .height(100).backgroundColor(0x46A2B4).textAlign(TextAlign.Center) } -- GitLab