[![npm][npm]][npm-url]
[![node][node]][node-url]
[![deps][deps]][deps-url]
[![tests][tests]][tests-url]
[![coverage][cover]][cover-url]
[![chat][chat]][chat-url]
<div align="center">
<img width="180" height="180" hspace="10"
alt="PostCSS Logo"
src="https://api.postcss.org/logo.svg">
<a href="https://github.com/webpack/webpack">
<img width="200" height="200" hspace="10"
src="https://cdn.rawgit.com/webpack/media/e7485eb2/logo/icon.svg">
</a>
<div align="center">
<a href="https://evilmartians.com/?utm_source=postcss">
<img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg"
alt="Sponsored by Evil Martians" width="236" height="54" vspace="10">
</a>
</div>
<h1>PostCSS Loader</h1>
<p>Loader for <a href="https://webpack.js.org/">webpack</a> to process CSS with <a href="https://postcss.org/">PostCSS</a></p>
</div>
<h2 align="center">Install</h2>
```bash
npm i -D postcss-loader
```
<h2 align="center">Usage</h2>
### `Configuration`
**`postcss.config.js`**
```js
module.exports = {
parser: 'sugarss',
plugins: {
'postcss-import': {},
'postcss-preset-env': {},
'cssnano': {}
}
}
```
You can read more about common PostCSS Config [here](https://github.com/michael-ciniawsky/postcss-load-config).
### `Config Cascade`
You can use different `postcss.config.js` files in different directories.
Config lookup starts from `path.dirname(file)` and walks the file tree upwards until a config file is found.
```
|– components
| |– component
| | |– index.js
| | |– index.png
| | |– style.css (1)
| | |– postcss.config.js (1)
| |– component
| | |– index.js
| | |– image.png
| | |– style.css (2)
|
|– postcss.config.js (1 && 2 (recommended))
|– webpack.config.js
|
|– package.json
```
After setting up your `postcss.config.js`, add `postcss-loader` to your `webpack.config.js`. You can use it standalone or in conjunction with `css-loader` (recommended). Use it **after** `css-loader` and `style-loader`, but **before** other preprocessor loaders like e.g `sass|less|stylus-loader`, if you use any.
**`webpack.config.js`**
```js
module.exports = {
module: {
rules: [
{
test: /\.css$/,
use: [ 'style-loader', 'postcss-loader' ]
}
]
}
}
```
> ⚠️ When `postcss-loader` is used standalone (without `css-loader`) don't use `@import` in your CSS, since this can lead to quite bloated bundles
**`webpack.config.js` (recommended)**
```js
module.exports = {
module: {
rules: [
{
test: /\.css$/,
use: [
'style-loader',
{ loader: 'css-loader', options: { importLoaders: 1 } },
'postcss-loader'
]
}
]
}
}
```
<h2 align="center">Options</h2>
|Name|Type|Default|Description|
|:--:|:--:|:-----:|:----------|
|[`exec`](#exec)|`{Boolean}`|`undefined`|Enable PostCSS Parser support in `CSS-in-JS`|
|[`parser`](#syntaxes)|`{String\|Object}`|`undefined`|Set PostCSS Parser|
|[`syntax`](#syntaxes)|`{String\|Object}`|`undefined`|Set PostCSS Syntax|
|[`stringifier`](#syntaxes)|`{String\|Object}`|`undefined`|Set PostCSS Stringifier|
|[`config`](#config)|`{Object}`|`undefined`|Set `postcss.config.js` config path && `ctx`|
|[`plugins`](#plugins)|`{Array\|Function}`|`[]`|Set PostCSS Plugins|
|[`sourceMap`](#sourcemap)|`{String\|Boolean}`|`false`|Enable Source Maps|
### `Exec`
If you use JS styles without the [`postcss-js`][postcss-js] parser, add the `exec` option.
**`webpack.config.js`**
```js
{
test: /\.style.js$/,
use: [
'style-loader',
{ loader: 'css-loader', options: { importLoaders: 1 } },
{ loader: 'postcss-loader', options: { parser: 'sugarss', exec: true } }
]
}
```
### `Config`
|Name|Type|Default|Description|
|:--:|:--:|:-----:|:----------|
|[`path`](#path)|`{String}`|`undefined`|PostCSS Config Directory|
|[`context`](#context)|`{Object}`|`undefined`|PostCSS Config Context|
#### `Path`
You can manually specify the path to search for your config (`postcss.config.js`) with the `config.path` option. This is needed if you store your config in a separate e.g `./config || ./.config` folder.
> ⚠️ Otherwise it is **unnecessary** to set this option and is **not** recommended
> ⚠️ Note that you **can't** use a **filename** other than the [supported config formats] (e.g `.postcssrc.js`, `postcss.config.js`), this option only allows you to manually specify the **directory** where config lookup should **start** from
**`webpack.config.js`**
```js
{
loader: 'postcss-loader',
options: {
config: {
path: 'path/to/.config/' ✅
path: 'path/to/.config/css.config.js' ❌
}
}
}
```
[supported config formats]: https://github.com/michael-ciniawsky/postcss-load-config#usage
#### `Context (ctx)`
|Name|Type|Default|Description|
|:--:|:--:|:-----:|:----------|
|`env`|`{String}`|`'development'`|`process.env.NODE_ENV`|
|`file`|`{Object}`|`loader.resourcePath`|`extname`, `dirname`, `basename`|
|`options`|`{Object}`|`{}`|Options|
`postcss-loader` exposes context `ctx` to the config file, making your `postcss.config.js` dynamic, so can use it to do some real magic ✨
**`postcss.config.js`**
```js
module.exports = ({ file, options, env }) => ({
parser: file.extname === '.sss' ? 'sugarss' : false,
plugins: {
'postcss-import': { root: file.dirname },
'postcss-preset-env': options['postcss-preset-env'] ? options['postcss-preset-env'] : false,
'cssnano': env === 'production' ? options.cssnano : false
}
})
```
**`webpack.config.js`**
```js
{
loader: 'postcss-loader',
options: {
config: {
ctx: {
'postcss-preset-env': {...options},
cssnano: {...options},
}
}
}
}
```
### `Plugins`
**`webpack.config.js`**
```js
{
loader: 'postcss-loader',
options: {
ident: 'postcss',
plugins: (loader) => [
require('postcss-import')({ root: loader.resourcePath }),
require('postcss-preset-env')(),
require('cssnano')()
]
}
}
```
> ⚠️ webpack requires an identifier (`ident`) in `options` when `{Function}/require` is used (Complex Options). The `ident` can be freely named as long as it is unique. It's recommended to name it (`ident: 'postcss'`)
### `Syntaxes`
|Name|Type|Default|Description|
|:--:|:--:|:-----:|:----------|
|[`parser`](#parser)|`{String\|Function}`|`undefined`|Custom PostCSS Parser|
|[`syntax`](#syntax)|`{String\|Function}`|`undefined`|Custom PostCSS Syntax|
|[`stringifier`](#stringifier)|`{String\|Function}`|`undefined`|Custom PostCSS Stringifier|
#### `Parser`
**`webpack.config.js`**
```js
{
test: /\.sss$/,
use: [
...,
{ loader: 'postcss-loader', options: { parser: 'sugarss' } }
]
}
```
#### `Syntax`
**`webpack.config.js`**
```js
{
test: /\.css$/,
use: [
...,
{ loader: 'postcss-loader', options: { syntax: 'sugarss' } }
]
}
```
#### `Stringifier`
**`webpack.config.js`**
```js
{
test: /\.css$/,
use: [
...,
{ loader: 'postcss-loader', options: { stringifier: 'midas' } }
]
}
```
### `SourceMap`
Enables source map support, `postcss-loader` will use the previous source map given by other loaders and update it accordingly, if no previous loader is applied before `postcss-loader`, the loader will generate a source map for you.
**`webpack.config.js`**
```js
{
test: /\.css/,
use: [
{ loader: 'style-loader', options: { sourceMap: true } },
{ loader: 'css-loader', options: { sourceMap: true } },
{ loader: 'postcss-loader', options: { sourceMap: true } },
{ loader: 'sass-loader', options: { sourceMap: true } }
]
}
```
#### `'inline'`
You can set the `sourceMap: 'inline'` option to inline the source map
within the CSS directly as an annotation comment.
**`webpack.config.js`**
```js
{
loader: 'postcss-loader',
options: {
sourceMap: 'inline'
}
}
```
```css
.class { color: red; }
/*# sourceMappingURL=data:application/json;base64, ... */
```
<h2 align="center">Examples</h2>
###
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
基于SSM框架和Vue.js技术的文学网系统旨在为文学爱好者提供一个在线阅读、分享和交流的平台。该系统包括文章管理、用户管理、评论管理、权限管理等功能模块,通过前后端分离的架构,实现了系统的灵活性和用户友好性。 主要特性包括: 文章管理:系统允许作者发布、编辑和删除文章,包括小说、散文、诗歌等文学作品。管理员可以审核和管理文章,确保内容的质量和合法性。 用户管理:系统记录并管理用户的基本信息,包括用户名、密码、个人资料等,用户可以注册、登录、修改密码等操作。管理员可以管理用户权限,包括封禁用户、恢复用户等操作。 评论管理:系统允许用户对文章进行评论和互动,管理员可以审核和管理评论,包括删除不合适的评论、屏蔽恶意言论等操作,维护良好的社区环境。 权限管理:系统设定不同角色的权限,包括管理员、作者、普通用户等,实现了对系统功能的精细化权限控制,保护用户的权益和信息安全。 文章分类与推荐:系统根据文章内容和用户喜好进行分类和推荐,提供个性化的阅读推荐,提高用户的阅读体验和满意度。 通过以上功能,文学网系统能够为用户提供一个优质的文学阅读和交流平台,促进作品的创作、分享和传播。系统的前端采用了Vue.js技术,实现了交互友好、界面美观的用户界面,提高了用户的使用体验和满意度。同时,系统基于SSM框架实现了后端业务逻辑,保证了系统的稳定性和可扩展性。
资源推荐
资源详情
资源评论
收起资源包目录
java源码期末大作业基于ssm的文学网的设计与实现+vue(源码+说明文档+lw).rar (887个子文件)
3-build.bat 16B
2-run.bat 14B
1-install.bat 12B
browserslist 378B
browserslist.cmd 369B
mkdirp.cmd 360B
performance-now.coffee 1KB
scripts.coffee 1KB
delayed-require.coffee 362B
delayed-call.coffee 358B
initial-value.coffee 313B
difference.coffee 175B
homeworkPC.min.css 450KB
front-kaoshi-style.css 450KB
app.fd35bf35.css 263KB
element.min.css 233KB
elementui.css 227KB
bootstrap.min.css 150KB
bootstrap.css 149KB
bootstrap.min.css 139KB
bootstrap.min.css 118KB
layui.css 73KB
skin.css 69KB
skin.css 68KB
skin.min.css 55KB
skin.min.css 55KB
chunk-vendors.1f0a25b2.css 37KB
skin.mobile.css 25KB
skin.mobile.css 25KB
skin.mobile.min.css 21KB
skin.mobile.min.css 21KB
content.css 20KB
content.inline.css 20KB
content.inline.css 20KB
content.css 20KB
content.min.css 18KB
content.inline.min.css 18KB
content.inline.min.css 18KB
content.min.css 17KB
layer.css 14KB
style.css 11KB
theme.css 11KB
layui.mobile.css 10KB
style.css 9KB
public.css 8KB
laydate.css 7KB
common.css 7KB
login.css 2KB
style.css 2KB
content.css 1KB
content.css 1KB
content.css 1KB
content.css 1KB
content.min.css 1KB
content.min.css 1KB
code.css 1KB
content.min.css 1KB
content.min.css 1009B
content.mobile.css 756B
content.mobile.css 756B
content.mobile.min.css 603B
content.mobile.min.css 603B
common.css 420B
iconfont.eot 46KB
glyphicons-halflings-regular.eot 20KB
index_35.gif 28KB
index_24.gif 12KB
59.gif 10KB
22.gif 10KB
24.gif 8KB
13.gif 7KB
16.gif 7KB
39.gif 6KB
64.gif 6KB
63.gif 6KB
50.gif 6KB
loading-0.gif 6KB
4.gif 6KB
1.gif 5KB
42.gif 5KB
71.gif 5KB
21.gif 5KB
20.gif 5KB
29.gif 5KB
70.gif 4KB
5.gif 4KB
17.gif 4KB
27.gif 4KB
9.gif 4KB
44.gif 4KB
11.gif 4KB
8.gif 4KB
3.gif 4KB
23.gif 4KB
34.gif 4KB
41.gif 4KB
38.gif 4KB
65.gif 3KB
32.gif 3KB
45.gif 3KB
共 887 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9
资源评论
程序猿阿存
- 粉丝: 1238
- 资源: 1804
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Oracle数据库工具安装包(免安装)
- Http上传文件到服务器 php文件
- 114.0.5734.1 Google Chrome谷歌浏览器下载
- meta-llama-3-8b-instruct 的 model-00002-of-00004.safetensors 的2/3
- subversion-1.14.3-6.fc41.x86-64.rpm
- GridLayoutCalculator.zip
- Release QMYSQL driver 6.2.4-msvc2019-x64
- mod-ldap-2.4.54-5.fc37.x86-64.rpm
- mod-ldap-2.4.56-1.fc38.x86-64.rpm
- mod-ldap-2.4.58-7.fc40.x86-64.rpm
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功