# 2019.03.29

[新闻] 前两天不是出个 996.icu 嘛,这又来个 955 不加班的名单:https://github.com/formulahendry/955.WLB (opens new window)

[文章] 微信,支付宝小程序实现原理概述:https://juejin.im/post/5c970d16f265da612d634475 (opens new window)

[类库] React 实现 Windows 95 的 UI 在线演示 (opens new window)https://github.com/React95/React95 (opens new window)

[类库] DropCSS 是一个用来清理无用 CSS 的小工具,它根据 HTML 和 CSS 作为输入并返回那些有用到的 CSS 信息:https://github.com/leeoniya/dropcss (opens new window)

[资源] 李笑来又把人人用英语放在 GitHub 上了,之前看过 GitBook 版本的:https://github.com/xiaolai/everyone-can-use-english (opens new window)

# 配图 - 微信,支付宝小程序实现原理

# 配图 - React 实现 Windows 95

# 示例 - DropCSS

const dropcss = require("dropcss");

let html = `
    <html>
        <head></head>
        <body>
            <p>Hello World!</p>
        </body>
    </html>
`;

let css = `
    .card {
      padding: 8px;
    }
    p {
      color:red;
    }

    p:hover a:first-child {
      color: red;
    }
`;

const whitelist = /#foo|\.bar/;

let dropped = new Set();

// returns { css }
let cleaned = dropcss({
  html,
  css,
  keepText: false,
  shouldDrop: sel => {
    if (whitelist.test(sel)) return false;
    else {
      dropped.add(sel);
      return true;
    }
  }
});

console.log(cleaned.css);

console.log(dropped);

# 今日图 - 软件设计模式

Last Updated: 3/29/2019, 1:56:30 PM