zoukankan      html  css  js  c++  java
  • [TypeStyle] Use fallback values in TypeStyle for better browser support

    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"));
  • 相关阅读:
    Logistic回归
    朴素贝叶斯
    决策树
    K-邻近(KNN)算法
    快速排序
    归并排序
    希尔排序
    插入排序
    选择排序
    浅谈系统服务分发
  • 原文地址:https://www.cnblogs.com/Answer1215/p/6960743.html
Copyright © 2011-2022 走看看