Comments (9)
Excuse me, I read the docs you provided and what I saw is that the front awesome 5 needs fa-
prefix.
I am providing an option which can add this prefix on all of your icon.
If you are suggesting to change the default value, I am afraid I will not accept it.
The reason I am using icon-
for default is that most of my theme users including myself are chinese, and we use iconfont.
If you have other problems, welcome to decribe more specificly.
from vuepress-theme-hope.
Sorry, Mr.Hope. This is quite misleading. I don't mean to change the default value. May be the explanation below is better
Let's take a look at the picture below:
As you see, each icon have different prefix: fas, far, fal, fad, fab which mean that you have to set different prefixes to every individual icon instead of adding this prefix on all icon
For example:
We will use icon: "fas fa-camera"
instead of:
icon: "fa-camera"
iconPrefix: "fas ",
from vuepress-theme-hope.
Got it, currently I am on a trip, I will try to provide better support after I return home.
from vuepress-theme-hope.
I was thinking to make a better enhancement, but I am not catching up some great ideas. If you are using only one style of icon in your site, I think it's possible for you to set iconPrefix
to fas fa-
or far fa-
and so on. Then it will be easy for you to set the prefix. If you are using different icons accross the site, I can not provide with some options for you to group those icons with same style.
The only thing I can enhance is that:
- Providing three optional options:
navbarIconPrefix
sidebarIconPrefix
pageIconPrefix
. - Let all the icon key support both
string
andstring[]
I will consider the second one as a good enhancement, But I am not sure we really need the first one.
from vuepress-theme-hope.
The first one is useless anyway.
The second look better than the first one
Actually their is a small workaround for this:
iconPrefix:" " //Avoid adding prefix
icon: "fas fa-camera"
icon: "far fa-camera" //Set it manually
// Don't know if adding a boolean to disable iconPrefix setting may be good as well
from vuepress-theme-hope.
Hey there, below is my code:
private get iconPrefix(): string {
const { iconPrefix } = this.$themeConfig;
return iconPrefix === "" ? "" : iconPrefix || "icon-";
}
So I think you can just use iconPrefix: ""
to unset the default prefix.(I wound prefer one configuation to be a certain type instead of adding a false
value)
Besides, i am not sure if the style class must be placed before the icon type class, so I think
// config
iconPrefix: "fa-"
icon: "camera fas"
icon: "camera far"
would be better.
from vuepress-theme-hope.
Also, I think again for the second improvement, and I decide not to do it.
Before:
JS:
icon: "fas fa-camera"
Front matter:
icon: fas fa-camera
After:
JS:
icon: ["fas", "fa-camera"]
Front matter:
icon:
- fas
- fa-camera
It's making configuration more complicated.
from vuepress-theme-hope.
Besides, i am not sure if the style class must be placed before the icon type class, so I think
// config iconPrefix: "fa-" icon: "camera fas" icon: "camera far"would be better.
I think so, because all fontawesome's icon have fa- and this way look better
from vuepress-theme-hope.
I am going to close this issue since all the problems have been discussed.
from vuepress-theme-hope.
Related Issues (20)
- [Feature Request] Remove theme transition
- [Feature Request] 能否把`@mdit/plugin-container`中的`marker`选项添加到`MdEnhance 插件`配置中 HOT 1
- 代码块有没有可能折叠?[Feature Request] HOT 2
- [Bug]设置 必应壁纸 或 一言描述 后,运行 pnpm run docs:dev 报错 HOT 2
- [Bug] The jsonLd argument of SeoOptions is mismatched with the documentation
- [Bug]侧边栏布局问题 HOT 4
- [Bug] ERROR: No loader is configured for ".vue" files HOT 1
- [Feature Request] Can add a function to support one -click configuration summary? HOT 6
- [Feature Request]search-pro在配合全局加密时,search-pro.worker.js会暴露出内容,希望可以加密一下索引。
- 做一个内容容器,类似于提示容器 HOT 3
- [Bug]全屏按钮设置不生效 HOT 1
- [Bug] 评论插件好像坏了 giscus 报 403 HOT 4
- [Feature Request] Support license in frontmatter for copyright2 in theme
- [Bug] navbar can't scroll if window is narrow HOT 1
- [Feature Request] 将 “star” 翻译为 “星标” HOT 2
- [Feature Request] markdown 文件引入 HOT 2
- [Feature Request] Add reading-time2 demo website
- [Feature Request] 添加水印预设
- [Bug] 左上角logo处在无障碍下检测出 图片元素缺少 [alt] 属性 HOT 1
- [Feature Request] 支持通过 props 传入 `<Breadcrumb>` 配置 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vuepress-theme-hope.