GithubHelp home page GithubHelp logo

creativebulma / bulma-badge Goto Github PK

View Code? Open in Web Editor NEW
45.0 45.0 12.0 147 KB

Bulma extension to display a badge attached to any kind of element, in different position.

License: MIT License

JavaScript 57.32% HTML 10.96% Sass 31.71%

bulma-badge's People

Contributors

creativebulma avatar gaetan-hexadog avatar xroll avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bulma-badge's Issues

Bulma v1 compat?

Now bulma v1 has dropped, are there plans to make your excellent plugins (divider etc) as well as this compatible?

Doesn't work for tabs

easily display a badge attached to any kind of element, in different position

Not true.

<div class="tabs">
  <ul>
    <li class="is-active"><a href="#">Tab1</a></li>
    <li>
      <a href="#">
        <span class="badge is-right">42</span>
        Tab2
      </a>
    </li>
  </ul>
</div>

<div>
  <p>Dolorum accusantium ut reprehenderit sint harum hic est?<br>
  Molestias adipisci suscipit quo.<br>
  Et et est qui qui fugiat et.<br>
  Ea consequatur fuga doloribus.<br>
  Est et laudantium ut voluptas eius rem officia in ipsam?</p>
</div>

How to use with b-tab-item?

This project seems to be what I'm looking for, but I can't seem to get it to work with b-tab-item.

<b-tab-item label="Tab Name">
    <span title="Badge top right" class="badge">42</span>
    ... contents
</b-tab-item>

Puts 42 (unstyled) at the top of the contents.

I tried using display: relative on a variety of elements without success.

What am I missing?

Relative position is a requirement

The definition says "any kind of element", but I found that it is not exactly true.
First, I wanted to attach to a progress, but it's kind of an unfinished element in the HTML specification (in my opinion) and the usage is very limited. (I actually wanted to use this badge as a workaround to the problem, that I cannot display text on the progress.)

Then, I tried to use it with the parent div of the progress. In that case the badge appeared but in the top right corner of the screen.

After I read #1, I got to understand that the display: relative rule is a requirement for this badge to work, so I do think the documentation should mention it or does not state simply „any kind of element”.

Deprecation Warning

Recommendation: math.div($badge-height, 2) or calc($badge-height / 2)

More info and automated migrator: https://sass-lang.com/d/slash-div

   ╷
71 │     line-height: calc(#{$badge-height / 2} + 1px)
   │                         ^^^^^^^^^^^^^^^^^
   ╵
    ~@creativebulma/bulma-badge/src/sass/index.sass 71:25  @import
    src/content/app.scss 19:9                              root stylesheet

Done in 2.23s.

Add support for navbar

I am using this with navbar-link inside of the header, and it currently does not work very well, even though position relative is applied to it.

I have added the below to fix the issue, although I am sure there is a better way to do this.

	&.is-left,
	&.is-right,
	&.is-top,
	&.is-top-left,
	&.is-top-right,
	&.is-bottom,
	&.is-bottom-left,
	&.is-bottom-right
		&.is-nav
			transform: translate(-5px, 10px)

Using it like so:

<div class="navbar-item has-dropdown is-hoverable is-icon">
    <a class="navbar-link">
        <span class="badge is-nav is-top-right" />
        <i class="fas fa-code"></i>
    </a>
</div>

Badge z-index to hight

Hi!

z-index badge is 99 and for example if you have a modal or navbar fixed top the badge is hover all the elements.

To reproduce you can create a badge and put a navbar fixed top, create a mod or open a dropdown near that badge.

Some examples:

Captura de pantalla 2020-11-04 a las 10 05 36

Captura de pantalla 2020-11-06 a las 11 39 47

I think reducing this z-index to 40 or lower could solve that problem.

Thanks!

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.