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. colrm---删除文件制定列

  2. C#学习第一课

    C#和Java存在很多相似之处,但是也存在一些差异.今天下午刚去图书馆借了C#的入门书籍,进过简单的入门,我了解了几点不同之处: 1. Java中的基本数据类型只有8种,数据类型不存在无符号和有符号的 ...

  3. oracle多实例的启动与关闭

    Oracle/oracle登录 1.启监听器 lsnrctl start 监听一般不需要动,如果机器重新启动的话需要将监听启动. 查看当前SID:echo $ORACLE_SID 2.启动数据库实例: ...

  4. [Angular & Unit Testing] Automatic change detection

    When you testing Component rendering, you often needs to call: fixture.detectChanges(); For example: ...

  5. 【项目基础】容器、AOP理论篇

    一.容器(砂锅) 1.概念: 容器是应用server中位于组件和平台之间的接口集合 2.应用: 容器一般位于应用server之内,由应用server负责载入和维护.一个容器仅仅能存在于一个应用serv ...

  6. apue和unp的学习之旅07——多种边界条件的讨论

    了解一些边界条件,通过观察这些情形,弄清在网络层次发生什么以及它们怎样反映到套接字api,这将很多其它地理解这些层次的工作原理,体会怎样编写应用程序来处理这些情形. //--------------- ...

  7. Flume的可靠性

    Flume的可靠性 当节点出现故障时,日志能够被传送到其他节点上而不会丢失. Flume提供了三种级别的可靠性保障,从强到弱依次分别为:end-to- end(收到数据agent首先将event写到磁 ...

  8. 洛谷 P2679 子串

    题目背景 无 题目描述 有两个仅包含小写英文字母的字符串 A 和 B.现在要从字符串 A 中取出 k 个互不重叠的非空子串,然后把这 k 个子串按照其在字符串 A 中出现的顺序依次连接起来得到一 个新 ...

  9. BZOJ2565: 最长双回文串(Manacher)

    Description 顺序和逆序读起来完全一样的串叫做回文串.比如acbca是回文串,而abc不是(abc的顺序为“abc”,逆序为“cba”,不相同).输入长度为n的串S,求S的最长双回文子串T, ...

  10. SQL分页的几种方式

    1.使用Row_number() over(order by columnName)函数来作为标示分页(下面的例子都是以last_seen来排序的,要求取顺序为20-30行的数据) SELECT Us ...