From 5b119040f9906550f7e84d5da5d9c458ac52fd13 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 6 May 2019 11:36:41 +0800 Subject: [PATCH] =?UTF-8?q?BI-44549=20feat:=20=E5=AD=97=E4=BD=93=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E6=B7=BB=E5=8A=A0=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 11 +++++++++++ dist/2.0/fineui.css | 2 +- dist/bundle.css | 2 +- dist/fineui.css | 2 +- dist/resource.css | 2 +- public/css/font.css | 2 +- src/css/resource/font.css | 2 +- src/less/image.less | 28 ++++++++++++++++++++++++++++ src/less/resource/font.less | 15 ++------------- ui/css/font.css | 2 +- 10 files changed, 48 insertions(+), 20 deletions(-) diff --git a/changelog.md b/changelog.md index 3caf08032..8b0520fe9 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,15 @@ # 更新日志 +2.0(2019-05) +- 增加less函数: 字体资源添加函数addFontRe和字体激活函数activeFont + +> @fontList: "dec", "report"; +> .addFontRes("dec"); +> .addFontRes("report"); +> .activeFont(@fontList); + +以上即可使用自定义的dec,report字体和fineui的资源字体 + + 2.0(2019-04) - 新增`bi.multi_tree_list_combo`控件, 此下拉树勾选节点时不会影响父子节点的勾选状态 - 新增`bi.multi_tree_insert_combo`控件, 此下拉树可以插入不存在的新值 diff --git a/dist/2.0/fineui.css b/dist/2.0/fineui.css index a79c4483e..b4cb0cbe7 100644 --- a/dist/2.0/fineui.css +++ b/dist/2.0/fineui.css @@ -4901,7 +4901,7 @@ textarea::-webkit-scrollbar-thumb:hover { _background: none; } @font-face { - font-family: 'bi'; + font-family: "bi"; src: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/font/iconfont.eot'); src: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/font/iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/font/iconfont.woff') format('woff'), /* chrome、firefox */ url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/font/iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/font/iconfont.svg#svgFontName') format('svg'); /* iOS 4.1- */ diff --git a/dist/bundle.css b/dist/bundle.css index a79c4483e..b4cb0cbe7 100644 --- a/dist/bundle.css +++ b/dist/bundle.css @@ -4901,7 +4901,7 @@ textarea::-webkit-scrollbar-thumb:hover { _background: none; } @font-face { - font-family: 'bi'; + font-family: "bi"; src: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/font/iconfont.eot'); src: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/font/iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/font/iconfont.woff') format('woff'), /* chrome、firefox */ url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/font/iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/font/iconfont.svg#svgFontName') format('svg'); /* iOS 4.1- */ diff --git a/dist/fineui.css b/dist/fineui.css index b69607745..799b619b5 100644 --- a/dist/fineui.css +++ b/dist/fineui.css @@ -4901,7 +4901,7 @@ textarea::-webkit-scrollbar-thumb:hover { _background: none; } @font-face { - font-family: 'bi'; + font-family: "bi"; src: url('resources?path=/com/fr/web/ui/font/iconfont.eot'); src: url('resources?path=/com/fr/web/ui/font/iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('resources?path=/com/fr/web/ui/font/iconfont.woff') format('woff'), /* chrome、firefox */ url('resources?path=/com/fr/web/ui/font/iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('resources?path=/com/fr/web/ui/font/iconfont.svg#svgFontName') format('svg'); /* iOS 4.1- */ diff --git a/dist/resource.css b/dist/resource.css index fe83a374a..ec77632e2 100644 --- a/dist/resource.css +++ b/dist/resource.css @@ -414,7 +414,7 @@ textarea::-webkit-scrollbar-thumb:hover { _background: none; } @font-face { - font-family: 'bi'; + font-family: "bi"; src: url('font/iconfont.eot'); src: url('font/iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('font/iconfont.woff') format('woff'), /* chrome、firefox */ url('font/iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('font/iconfont.svg#svgFontName') format('svg'); /* iOS 4.1- */ diff --git a/public/css/font.css b/public/css/font.css index 0d45e92fb..9abc38fe2 100644 --- a/public/css/font.css +++ b/public/css/font.css @@ -1,5 +1,5 @@ @font-face { - font-family: 'bi'; + font-family: "bi"; src: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/font/iconfont.eot'); src: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/font/iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/font/iconfont.woff') format('woff'), /* chrome、firefox */ url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/font/iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/font/iconfont.svg#svgFontName') format('svg'); /* iOS 4.1- */ diff --git a/src/css/resource/font.css b/src/css/resource/font.css index e9827a2c3..16ce6fef8 100644 --- a/src/css/resource/font.css +++ b/src/css/resource/font.css @@ -1,5 +1,5 @@ @font-face { - font-family: 'bi'; + font-family: "bi"; src: url('font/iconfont.eot'); src: url('font/iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('font/iconfont.woff') format('woff'), /* chrome、firefox */ url('font/iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('font/iconfont.svg#svgFontName') format('svg'); /* iOS 4.1- */ diff --git a/src/less/image.less b/src/less/image.less index df60b8aa0..e7acfa257 100644 --- a/src/less/image.less +++ b/src/less/image.less @@ -332,6 +332,34 @@ } } +// 添加字体资源 +.addFontRes(@name, @fontUrl) { + @font-face { + font-family: "@{name}"; + src: url('@{fontUrl}iconfont.eot'); + src: url('@{fontUrl}iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('@{fontUrl}iconfont.woff') format('woff'), /* chrome、firefox */ url('@{fontUrl}iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('@{fontUrl}iconfont.svg#svgFontName') format('svg'); /* iOS 4.1- */ + } +} + +// 激活字体 +.activateFont(@fonts) { + @baseProperty: { + font-style: normal; + -webkit-font-smoothing: antialiased; + -webkit-text-stroke-width: 0.2px; + -moz-osx-font-smoothing: grayscale; + }; + + .b-font when not ((length(@fonts) = 1) and (extract(@fonts, 1) = "bi")) { + font-family: @fonts, "bi"; + @baseProperty(); + } + .b-font when ((length(@fonts) = 1) and (extract(@fonts, 1) = "bi")) { + font-family: @fonts; + @baseProperty(); + } +} + // 默认font .font(@class,@content, @color: @color-bi-font-native) { @fc: "\@{content}"; diff --git a/src/less/resource/font.less b/src/less/resource/font.less index b789868b0..8e9a04961 100644 --- a/src/less/resource/font.less +++ b/src/less/resource/font.less @@ -2,19 +2,8 @@ @import "../lib/colors"; @import "../image"; -@font-face { - font-family: 'bi'; - src: url('@{fontUrl}iconfont.eot'); - src: url('@{fontUrl}iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('@{fontUrl}iconfont.woff') format('woff'), /* chrome、firefox */ url('@{fontUrl}iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('@{fontUrl}iconfont.svg#svgFontName') format('svg'); /* iOS 4.1- */ -} - -.b-font { - font-family: "bi"; - font-style: normal; - -webkit-font-smoothing: antialiased; - -webkit-text-stroke-width: 0.2px; - -moz-osx-font-smoothing: grayscale; -} +.addFontRes("bi", @fontUrl); +.activateFont("bi"); .font(close-font, @font-cross); .font-hover(close-h-font, @font-cross); diff --git a/ui/css/font.css b/ui/css/font.css index 977a99dc1..fb49d206c 100644 --- a/ui/css/font.css +++ b/ui/css/font.css @@ -1,5 +1,5 @@ @font-face { - font-family: 'bi'; + font-family: "bi"; src: url('resources?path=/com/fr/web/ui/font/iconfont.eot'); src: url('resources?path=/com/fr/web/ui/font/iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('resources?path=/com/fr/web/ui/font/iconfont.woff') format('woff'), /* chrome、firefox */ url('resources?path=/com/fr/web/ui/font/iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('resources?path=/com/fr/web/ui/font/iconfont.svg#svgFontName') format('svg'); /* iOS 4.1- */