Code Monkey home page Code Monkey logo

Comments (5)

Hidetaro7 avatar Hidetaro7 commented on September 2, 2024

ツールチップを表示しないことが考えにくいのであれば

表示しなくてもいい場合も一般的にある話しなので、data-labelの有無で機能の切り替えということにはできないでしょうか? @knokmki612

from jumpu-ui.

knokmki612 avatar knokmki612 commented on September 2, 2024

擬似要素としてツールチップを表現しているのを、 role="tooltip" によって表現したほうが、同じような属性に同じような値をつける冗長さを避けられるかもしれません。

参考: https://www.w3.org/TR/wai-aria-1.2/#tooltip

before

<button class="icon-button" aria-label="Twitter" data-label="Twitter">    
  <i class="fab fa-twitter"></i>
</button>

after

<button class="icon-button" aria-describedby="tooltip">    
  <i class="fab fa-twitter"></i>
  <span id="tooltip" role="tooltip">Twitter</span>
</button>

from jumpu-ui.

Hidetaro7 avatar Hidetaro7 commented on September 2, 2024

実際の利用について思うことなんですが、
毎回id名は自分で考えてマークアップするような使い方になりますか?

個人的に考えることが多くなるなあという印象でした。
確かに記述といしてはafterのほうが良いとは思いますが、悩みます。

from jumpu-ui.

knokmki612 avatar knokmki612 commented on September 2, 2024

idの名前付けを毎回考えるのが大変なので、それが解決できればafter案でよいのではという話になった。

Math.round(Math.random() * Number.MAX_SAFE_INTEGER など衝突しない値を生成して楽にidを生成、参照できる工夫をしてafterへ変更する

やること

  • id生成のスクリプトを用意する
  • after案に変更する

from jumpu-ui.

Hidetaro7 avatar Hidetaro7 commented on September 2, 2024

@knokmki612 マークアップを変更しました。

from jumpu-ui.

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.