Tailwind Opacity Utility Classes

栏目: IT技术 · 发布时间: 5年前

内容简介:Let's take a look at the colorThe new classes will let us

Tailwind 1.4 just got released and with it comes three really cool things:

  1. Color opacity utlities
  2. Built-in PurgeCSS
  3. IE 11 target mode (experimental)

Let's take a look at the color opacity utilities . We already had the opacity class to set the opacity of an entire element.

  • opacity-{0|25|50|75|100}

The new classes will let us set opacity of certain attributes .

I've often wanted to set the opacity of the background of an element, but not the text of the element. This usually meant I had to write some custom CSS to create:

/_ black background at 10% opacity _/
background: rgba(0, 0, 0, 0.1);

Now we have the following classes to set various things!

The value can be 0 , 25 , 50 , 75 , 100

Here's an example:

<button>
    my background is 75% opacity
</button>

Here's a CodePen for background opacity with Tailwind.

Not sure what the divide-opacity does though 路‍♂️

Like this article? Follow @chrisoncode on Twitter


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

创业小败局

创业小败局

创业家、i黑马 / 时代华文书局 / 2014-8-1 / 42.00元

让别人的失败,成为你的成功之母! 《创业小败局》由徐小平、何伯权等六位经验丰富的业界大佬,从《创业家》五年来跟踪的数千个创业案例中,精心挑选而来。21个最具代表性的失败案例,每个案例都代表了一种最常见的失败规律,也基本上覆盖了当下中国创业浪潮中,最容易遭遇的创业陷阱。失 败是有规律的。有时候创业者的选择和 行为,必然会导致失败,但当事人却因为缺乏经验而没有察觉。比如在错误心态下引入错误的合伙......一起来看看 《创业小败局》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

html转js在线工具
html转js在线工具

html转js在线工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具