Giter Club home page Giter Club logo

Comments (10)

oleedd avatar oleedd commented on June 17, 2024

not @oleed but @oleedd

from chrome-minimal-bookmarks-tree.

rpkamp avatar rpkamp commented on June 17, 2024

Pull request opened: #95

from chrome-minimal-bookmarks-tree.

oleedd avatar oleedd commented on June 17, 2024

I don't think it is a good way to check all fonts. It is not optimal. The best way is to set the default font css to this <option> element when you create it.

from chrome-minimal-bookmarks-tree.

rpkamp avatar rpkamp commented on June 17, 2024

The problem is that if I don't check for __default__ then the extension will set the font-family for the select to the font __default__, which doesn't exist, but causes the browser to render some other font than the default (no idea which is selects).

I agree that setting a default would be better, but it's system dependent, so I can't know for all computers what their default font is, so I can't supply one.

It is not optimal.

Correct, but it's not like people use this several times a day, I'm sure they can wait an extra few milliseconds when they want to change the font 😉

from chrome-minimal-bookmarks-tree.

oleedd avatar oleedd commented on June 17, 2024

Maybe you can use just this after <select> with all fonts is built:
dropdowns[0].style.fontFamily = "revert"
I think rewriting is better than many checks.
Also it is better to create the "Default" option not in a html file but using JS after <select> with all fonts is built. It makes no problems.

from chrome-minimal-bookmarks-tree.

rpkamp avatar rpkamp commented on June 17, 2024

dropdowns[0].style.fontFamily = "revert"

That just replaces the CSS, the checking against __default__ would still be needed.

Also it is better to create the "Default" option not in a html file but using JS after <select> with all fonts is built. It makes no problems.

It doesn't really matter. Since it must be there always I prefer it in the HTML as that makes it more clear that it will always be there. It's really not important though.

from chrome-minimal-bookmarks-tree.

oleedd avatar oleedd commented on June 17, 2024

OK. An iron working way:
font.children[0].style.fontFamily = "revert"
Or to use "fontList" here:
image
I have checked this and it works. So only one string fixes this issue without any additional checks.

from chrome-minimal-bookmarks-tree.

rpkamp avatar rpkamp commented on June 17, 2024

No it does not. The issue is that it sets font-family: __default__ on the <select> element. Your fix does not solve that.

It's fine as is. I don't care about an extremely minor performance thing in a settings form. I didn't actually notice any delay.

Don't fix something that isn't broken.

from chrome-minimal-bookmarks-tree.

rpkamp avatar rpkamp commented on June 17, 2024

Ah, I get it now. It's just that I didn't understand because you solved in the javascript what I would have solved in the HTML.

I've solved it in the HTML now: #100

Thanks 👍

from chrome-minimal-bookmarks-tree.

oleedd avatar oleedd commented on June 17, 2024

Oh. I meant exactly that initially 👍

Don't fix something that isn't broken.

Not possible to fix something that isn't broken. It is only about improving.

from chrome-minimal-bookmarks-tree.

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.