• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

preactjs-templates/material: The material design `preact-cli` template

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

preactjs-templates/material

开源软件地址(OpenSource Url):

https://github.com/preactjs-templates/material

开源编程语言(OpenSource Language):

JavaScript 83.2%

开源软件介绍(OpenSource Introduction):

THIS TEMPLATE IS DEPRECATED

preact-material-boilerplate

Documentation

Usage

$ npm install -g preact-cli
$ preact create material my-project
$ cd my-project
$ npm install
$ npm run dev

Development server runs on port 8080. If the default port is already in use on your machine it will start the development server on a random port.

Styling material components

In order to style the material components you can give class names to the components and target them with the css selector in any css files.

To style them globally use the index [style.css](https://github.com/preactjs-templates/material/blob/master/template/src/style/index.css), so that it affects it everywhere. e.g.

.mdc-dialog .mdc-dialog__surface{
  max-width: 300px;
  min-width: 0;
  color: tomato;
}

Theming

In order to alter the theme of the app you can again use the index [style.css](https://github.com/preactjs-templates/material/blob/master/template/src/style/index.css) and alter the theme variables in it defined here: https://material.io/develop/web/components/theme/#css-custom-properties

But you can also give class names to the components and use these variables to just change the theme of that component.

Commands

  • npm run start: Runs serve or dev, depending on NODE_ENV value. Defaults to dev server

  • npm run dev: Run a development, HMR server

  • npm run serve: Run a production-like server

  • npm run build: Production-ready build

  • npm run lint: Pass JavaScript files using ESLint

Fork It And Make Your Own

You can fork this repo to create your own boilerplate, and use it with preact-cli:

preact create username/repo my-project



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap