You can increase the browser support of your CSS using fallback values and vendor prefixes. This lesson covers using vendor prefixes and fallback values (single prop multiple values) with TypeStyle. It also shows best practices for maintaining variables in the presence of vendor prefixing.

import { style, cssRaw, types } from "typestyle";
import * as React from "react";
import * as ReactDOM from "react-dom"; cssRaw(`
body {
font-size: 1.5em;
font-weight: bold;
color: gold
}
`); const scroll: types.NestedCSSProperties = {
"-webkit-overflow-scrolling": "touch",
overflow: "auto"
}; const bg = style(scroll, {
backgroundColor: [
/* The fallback */
"rgb(200, 54, 54)",
/** Graceful upgrade */
"rgba(200, 54, 54, 0.5)"
]
}); const App = () =>
<div className={bg}>
Hello World!
</div>; ReactDOM.render(<App />, document.getElementById("root"));

[TypeStyle] Use fallback values in TypeStyle for better browser support的更多相关文章

  1. [TypeStyle] Load raw CSS in TypeStyle

    TypeStyle tries to be an all in one CSS in JS management solution so you can always fall back to raw ...

  2. [TypeStyle] Compose CSS classes using TypeStyle

    We will demonstrate composing classes using the utility classes function. classes is also what we re ...

  3. [TypeStyle] Style CSS pseudo-classes using TypeStyle with $nest

    TypeStyle is a very thin layer on top of CSS. In this lesson we show how to change styles based on p ...

  4. [TypeStyle] Add responsive styles using TypeStyle Media Queries

    Media queries are very important for designs that you want to work on both mobile and desktop browse ...

  5. ES8新特性——ES8 was Released and here are its Main New Features

    原文: https://hackernoon.com/es8-was-released-and-here-are-its-main-new-features-ee9c394adf66 -------- ...

  6. [TypeStyle] Add type safety to CSS using TypeStyle

    TypeStyle is the only current CSS in JS solution that is designed with TypeSafety and TypeScript dev ...

  7. jQ1.5源码注释以及解读RE

    jQ作为javascript的库( ▼-▼ ), 尽善尽美, 代码优美,  值得学习.  这一周平常上班没啥事也看jQ1.5的代码, 今天周六差不多看完了(Sizzle部分还没看), 重新看了一下, ...

  8. 【转】Styling And Animating SVGs With CSS

    原文转自:http://www.smashingmagazine.com/2014/11/03/styling-and-animating-svgs-with-css/?utm_source=CSS- ...

  9. HOCON 了解

    Spec This is an informal spec, but hopefully it's clear. Goals / Background The primary goal is: kee ...

随机推荐

  1. Kali linux查看局域网内其他用户的输入信息

    使用nmap 工具在局域网里进行侦探,查看局域网里ip存活数量 root@kali:~# nmap -sP 192.168.1.0/24 Starting Nmap 7.60 ( https://nm ...

  2. shell项目-分发系统-expect讲解

    shell项目-分发系统-expect讲解 yum install -y expect 1. 自动远程登录 #! /usr/bin/expect set host "192.168.133. ...

  3. col---过滤控制字符

  4. Springboot2.0访问Redis集群

    Redis 是一个开源(BSD许可)的,内存中的数据结构存储系统,它可以用作高性能的key-value数据库.缓存和消息中间件,掌握它是程序员的必备技能,下面是一个springboot访问redis的 ...

  5. Exclusive or

    题目连接 题意: 每次给一个n.求 (2≤n<10500) 分析: 先说一下自己的想法,假设将n换成二进制数,也就一两千位左右,那么一位一位处理是能够接受的. 将0-n写成二进制形式后,显然全部 ...

  6. 如果笔记本的 WIN7 运行很卡,请尝试运行这些批处理

    如果笔记本的 WIN7 运行很卡,请尝试运行这些批处理 WIN7是不是很卡?关掉下列服务吧 @echo off rem AppXSvc 为部署应用商店应用程序提供基础结构支持 rem BITS 微软的 ...

  7. php7 兼容 MySQL 相关函数

    php7 兼容 MySQL 相关函数 PHP7 废除了 ”mysql.dll” ,推荐使用 mysqli 或者 pdo_mysql http://PHP.net/manual/zh/mysqlinfo ...

  8. 对 hiren bootcd 15.2 中的 XP 系统作了汉化, 同时支持中文输入法。提供下载

    对 hiren bootcd 15.2 中的 XP 系统作了汉化, 同时支持中文输入法.提供下载 对该PE 中的 XP 系统作了汉化, 由于一个 中文字库 就要 10M 多:加之原系统过于精简,对中文 ...

  9. var、let和const的区别

    var 首先var有变量提升 console.log(a); // undefined var a = 1; function也存在提升现象 console.log(b); //function b( ...

  10. 【2017 Multi-University Training Contest - Team 7】Hard challenge

    [Link]:http://acm.hdu.edu.cn/showproblem.php?pid=6127 [Description] 平面上有n个点,每个点有一个价值,每两个点之间都有一条线段,定义 ...