GithubHelp home page GithubHelp logo

Comments (9)

Mister-Hope avatar Mister-Hope commented on May 5, 2024

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.

ItsBioDude avatar ItsBioDude commented on May 5, 2024

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:

image

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.

Mister-Hope avatar Mister-Hope commented on May 5, 2024

Got it, currently I am on a trip, I will try to provide better support after I return home.

from vuepress-theme-hope.

Mister-Hope avatar Mister-Hope commented on May 5, 2024

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:

  1. Providing three optional options: navbarIconPrefix sidebarIconPrefix pageIconPrefix.
  2. Let all the icon key support both string and string[]

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.

ItsBioDude avatar ItsBioDude commented on May 5, 2024

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.

Mister-Hope avatar Mister-Hope commented on May 5, 2024

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.

Mister-Hope avatar Mister-Hope commented on May 5, 2024

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.

ItsBioDude avatar ItsBioDude commented on May 5, 2024

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.

Mister-Hope avatar Mister-Hope commented on May 5, 2024

I am going to close this issue since all the problems have been discussed.

from vuepress-theme-hope.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.