Giter Club home page Giter Club logo

Comments (7)

astrit avatar astrit commented on May 14, 2024

@shaozi

Add flex class to the button like this:

<div class="btn btn-primary d-flex align-items-center">
      A button <span class="gg-sort-az"></span>
</div>

from css.gg.

shaozi avatar shaozi commented on May 14, 2024

But what about in a div or p element? I cannot put flexbox everywhere.
Why it is display as block not inline anyway?

from css.gg.

astrit avatar astrit commented on May 14, 2024

This is designed to be as standalone as possible, you can create a class and add it to every icon where you need and overwrite the display, or you can

 [class^="gg-"] {
   display: inline-flex; 
}

from css.gg.

shaozi avatar shaozi commented on May 14, 2024

Is there an easy way to unify all their size (same height) and alignment (align center)?
Screen Shot 2020-05-02 at 2 47 28 PM

from css.gg.

astrit avatar astrit commented on May 14, 2024

Yes, you can just create a div with class .icon-wrapper and then do t he following

    .icon-wrapper {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 24px;
        height: 24px;
    }

And then your markup would look like:

    <div class="icon-wrapper>
          <i class="gg-add"></i>
    </div>

Also you can use the SVG version if don't like doing it with CSS.

from css.gg.

MartB avatar MartB commented on May 14, 2024

Did you eventually figure out how to do this in css only?
Having the same problem at the moment and im wondering why the css icons dont behave correctly.

Looks like this with astrits code:
image

from css.gg.

Techassi avatar Techassi commented on May 14, 2024

This can fix vertical alignment of the Format Bold Icon:

margin-top: calc(-4px * var(--ggs));

Maybe @astrit can merge this, if approved.

from css.gg.

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.