12 Matching Annotations
  1. Last 7 days
    1. CSS Studio detects the CSS variables available on an element.

      令人惊讶的是:这个工具能够智能识别元素上可用的CSS变量,并允许设计师编辑这些变量,同时看到变化在整个网站上的传播效果。这种变量管理功能对于维护大型设计系统的一致性非常有价值,但很多开发者可能不知道有这样的工具存在。

  2. Nov 2021
  3. Aug 2021
    1. With JavaScript, you can actually calculate the width of the scrollbar and whether it’s visible by comparing two properties—window.innerWidth and document.body.clientWidth. If these are equal, the scrollbar isn’t visible. If these are different, we can subtract the body width from the window width to get the width of the scrollbar:const scrollbarWidth = window.innerWidth - document.body.clientWidthWe’ll want to perform this both on page load and on resize, in case someone resizes the window vertically and changes the overflow. Then, once we have the scrollbar width, we can assign it as a CSS variable:document.body.setProperty("--scrollbarWidth", `${scrollbarWidth}px`)

      missing feature: vw/vh can't be used "directly" because doesn't account for scrollbars

  4. Nov 2020
  5. Sep 2020