博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[TypeStyle] Style CSS pseudo elements with TypeStyle
阅读量:4495 次
发布时间:2019-06-08

本文共 1257 字,大约阅读时间需要 4 分钟。

Just like pseudo-classes, pseudo-elements are added to selectors but instead of describing a special state, they allow you to style certain parts of an element.

In this lesson we show how you can insert new content into the DOM using CSS pseudo elements. We also cover using other pseudo element selectors to change default browser behaviors.

 

import { style, media } from 'typestyle';import * as React from 'react';import * as ReactDOM from 'react-dom';const fontSize = (value: number | string) => {    const valueStr = typeof value === 'string' ?                     value :                     value + 'px';    return {        fontSize: valueStr    }};const className = style(    {        color: 'red',        transition: 'font-size 0.2s',        $nest: {            '&::after': {                content: `' Type after'`            },            '&::selection': {                backgroundColor: 'black',                color: 'gold'            }        }    },    media({maxWidth: 700, minWidth: 500}, fontSize(20)),    media({minWidth: 701}, fontSize(30)),    media({maxWidth: 499}, fontSize(15)));ReactDOM.render(    
Hello Typestyle
, document.getElementById('root'));

 

转载于:https://www.cnblogs.com/Answer1215/p/6946588.html

你可能感兴趣的文章
整合SpringDataJpa
查看>>
vue过渡
查看>>
tcpreplay 博客目录
查看>>
oracle11g忘记sys密码
查看>>
文件各种上传,离不开的表单
查看>>
mysql查询插入优化
查看>>
hadoop备战:yarn框架的搭建(mapreduce2)
查看>>
微信公众号开发模式开启总结
查看>>
pygame-KidsCanCode系列jumpy-part2-加速度与摩擦力
查看>>
[elk]logstash的grok匹配逻辑grok+date+mutate
查看>>
准备Android面试
查看>>
界面与后台逻辑完全分离,单例模式,接口
查看>>
redis安装及测试
查看>>
38-系统标准模块与第三方模块(1)
查看>>
[转]Android U 盘功能实现和分析
查看>>
dedecms织梦副栏目名称和链接调用
查看>>
iOS 离屏渲染学习笔记
查看>>
iOS Xib布局某些控件显示或隐藏<约束的修改>
查看>>
软件工程第一次作业
查看>>
乘法逆元+模的运算规则
查看>>