From 68da81a51af1ea9b8a0fc9b969a5d8113ba1f927 Mon Sep 17 00:00:00 2001 From: neverland Date: Thu, 19 Sep 2019 16:03:31 +0800 Subject: [PATCH] feat: improve word wrap (#4506) --- packages/vant-doc/src/component/Block.vue | 2 +- packages/vant-doc/src/style/highlight.less | 2 +- src/card/index.less | 2 +- src/dialog/index.less | 1 + src/grid-item/index.less | 2 +- src/notice-bar/index.less | 1 + src/notify/index.less | 1 + src/sidebar-item/index.less | 2 +- src/sku/index.less | 2 +- src/toast/index.less | 2 +- 10 files changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/vant-doc/src/component/Block.vue b/packages/vant-doc/src/component/Block.vue index 75163ce06..9c1a53044 100644 --- a/packages/vant-doc/src/component/Block.vue +++ b/packages/vant-doc/src/component/Block.vue @@ -22,7 +22,7 @@ export default { box-sizing: border-box; pre { - word-break: break-all; + word-wrap: break-word; } } } diff --git a/packages/vant-doc/src/style/highlight.less b/packages/vant-doc/src/style/highlight.less index 6c8279708..0db7858dd 100644 --- a/packages/vant-doc/src/style/highlight.less +++ b/packages/vant-doc/src/style/highlight.less @@ -11,7 +11,7 @@ code { font-family: @van-doc-code-font-family; line-height: 24px; white-space: pre-wrap; - word-break: break-all; + word-wrap: break-word; } pre { diff --git a/src/card/index.less b/src/card/index.less index d76ab92d2..a634e8ba4 100644 --- a/src/card/index.less +++ b/src/card/index.less @@ -40,7 +40,7 @@ &__title, &__desc { - word-break: break-all; + word-wrap: break-word; } &__title { diff --git a/src/dialog/index.less b/src/dialog/index.less index 1f2530c12..08b7a9ba9 100644 --- a/src/dialog/index.less +++ b/src/dialog/index.less @@ -35,6 +35,7 @@ // allow newline charactor white-space: pre-wrap; text-align: center; + word-wrap: break-word; -webkit-overflow-scrolling: touch; &--has-title { diff --git a/src/grid-item/index.less b/src/grid-item/index.less index 0e087980b..19a7a4aef 100644 --- a/src/grid-item/index.less +++ b/src/grid-item/index.less @@ -51,7 +51,7 @@ &__text { color: @grid-item-text-color; font-size: @grid-item-text-font-size; - word-break: break-all; + word-wrap: break-word; } &__icon + &__text { diff --git a/src/notice-bar/index.less b/src/notice-bar/index.less index e0d9741fa..897bfc073 100644 --- a/src/notice-bar/index.less +++ b/src/notice-bar/index.less @@ -57,6 +57,7 @@ &__content { position: relative; white-space: normal; + word-wrap: break-word; } } } diff --git a/src/notify/index.less b/src/notify/index.less index b03d45664..6bf356cfd 100644 --- a/src/notify/index.less +++ b/src/notify/index.less @@ -9,6 +9,7 @@ // allow newline charactor white-space: pre-wrap; text-align: center; + word-wrap: break-word; &--primary { background-color: @notify-primary-background-color; diff --git a/src/sidebar-item/index.less b/src/sidebar-item/index.less index e485ba22a..5014199d8 100644 --- a/src/sidebar-item/index.less +++ b/src/sidebar-item/index.less @@ -8,7 +8,7 @@ color: @sidebar-text-color; font-size: @sidebar-font-size; line-height: @sidebar-line-height; - word-break: break-all; + word-wrap: break-word; background-color: @sidebar-background-color; border-left: 3px solid transparent; user-select: none; diff --git a/src/sku/index.less b/src/sku/index.less index 18c8654ec..1a1e33f0e 100644 --- a/src/sku/index.less +++ b/src/sku/index.less @@ -75,7 +75,7 @@ font-weight: 500; font-size: 22px; vertical-align: middle; - word-break: break-all; + word-wrap: break-word; } &__goods-price { diff --git a/src/toast/index.less b/src/toast/index.less index 4df065baf..282925fce 100644 --- a/src/toast/index.less +++ b/src/toast/index.less @@ -22,7 +22,7 @@ // allow newline charactor white-space: pre-wrap; text-align: center; - word-break: break-all; + word-wrap: break-word; background-color: @toast-background-color; border-radius: @toast-border-radius; transform: translate3d(-50%, -50%, 0);