diff --git a/.vscode/settings.json b/.vscode/settings.json index 9e85d4fc..2c567d76 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,7 +9,7 @@ "files.trimTrailingWhitespace": false }, "[typescript]": { - "editor.defaultFormatter": "Vue.volar" + "editor.defaultFormatter": "vscode.typescript-language-features" }, "css.validate": false, "scss.validate": false, diff --git a/docs/.vuepress/config.ts b/docs/.vuepress/config.ts index fce3537b..f50466a4 100644 --- a/docs/.vuepress/config.ts +++ b/docs/.vuepress/config.ts @@ -9,10 +9,15 @@ export default defineUserConfig({ source: path.resolve(__dirname, '../'), public: path.resolve(__dirname, 'public'), locales: { - '/': { title: 'Plume主题', description: '', lang: 'zh-CN' }, - '/en/': { title: 'Plume Theme', description: '', lang: 'en-US' }, + '/': { title: 'Plume 主题', lang: 'zh-CN' }, + '/en/': { title: 'Plume Theme', lang: 'en-US' }, }, + head: [ + ['link', { rel: 'icon', type: 'image/png', sizes: '32x32', href: '/favicon-32x32.png' }], + ['link', { rel: 'icon', type: 'image/png', sizes: '16x16', href: '/favicon-16x16.png' }], + ], + bundler: viteBundler(), theme, diff --git a/docs/.vuepress/navbar.ts b/docs/.vuepress/navbar.ts index 70aec5ae..48f0cec4 100644 --- a/docs/.vuepress/navbar.ts +++ b/docs/.vuepress/navbar.ts @@ -1,64 +1,84 @@ import type { NavItem } from 'vuepress-theme-plume' +import { version } from '../../package.json' export const zhNavbar = [ - { text: '首页', link: '/', icon: 'material-symbols:home-outline' }, + { + text: '指南', + icon: 'icon-park-outline:guide-board', + link: '/guide/intro/', + activeMatch: '^/guide/', + }, + { + text: '配置', + icon: 'icon-park-outline:setting-two', + link: '/config/intro/', + activeMatch: '^/config/', + }, { text: '博客', link: '/blog/', icon: 'material-symbols:article-outline', + activeMatch: '^/(blog|article)/', }, { - text: 'VuePress', - icon: 'vscode-icons:file-type-vue', + text: '更多', items: [ { - text: 'theme-plume', - link: '/note/vuepress-theme-plume/', - icon: 'icon-park-outline:theme', - }, - { - text: '插件', - icon: 'mingcute:plugin-2-line', + text: 'Vuepress', items: [ - { - text: 'caniuse', - link: '/note/vuepress-plugin/caniuse/', - icon: 'tabler:brand-css3', - }, - { - text: 'netlify-functions', - link: '/note/vuepress-plugin/netlify-functions/', - icon: 'teenyicons:netlify-outline', - }, + { text: '官方文档', link: 'https://v2.vuepress.vuejs.org' }, + { text: '生态系统', link: 'https://ecosystem.vuejs.press/' }, ], }, ], }, - { text: '友情链接', link: '/friends/', icon: 'emojione-monotone:roller-coaster' }, + { + text: `${version}`, + icon: 'codicon:versions', + items: [ + { text: '更新日志', link: 'https://github.com/pengzhanbo/vuepress-theme-plume/blob/main/CHANGELOG.md' }, + { text: '参与贡献', link: 'https://github.com/pengzhanbo/vuepress-theme-plume/blob/main/CONTRIBUTING.md' }, + ], + }, ] as NavItem[] export const enNavbar = [ - { text: 'Home', link: '/en/', icon: 'material-symbols:home-outline' }, + { + text: 'Guide', + icon: 'icon-park-outline:guide-board', + link: '/en/guide/intro/', + activeMatch: '^/en/guide/', + }, + { + text: 'Config', + icon: 'icon-park-outline:setting-two', + link: '/en/config/intro/', + activeMatch: '^/en/config/', + }, { text: 'Blog', link: '/en/blog/', icon: 'material-symbols:article-outline', + activeMatch: '^/en/(blog|article)/', }, { - text: 'VuePress', - icon: 'vscode-icons:file-type-vue', + text: 'More', items: [ { - text: 'Plugin', - icon: 'mingcute:plugin-2-line', + text: 'Vuepress', items: [ - { - text: 'caniuse', - link: '/en/note/vuepress-plugin/caniuse/', - icon: 'tabler:brand-css3', - }, + { text: 'Official Docs', link: 'https://v2.vuepress.vuejs.org' }, + { text: 'Ecosystem', link: 'https://ecosystem.vuejs.press/' }, ], }, ], }, + { + text: `${version}`, + icon: 'codicon:versions', + items: [ + { text: 'Changelog', link: 'https://github.com/pengzhanbo/vuepress-theme-plume/blob/main/CHANGELOG.md' }, + { text: 'Contributing', link: 'https://github.com/pengzhanbo/vuepress-theme-plume/blob/main/CONTRIBUTING.md' }, + ], + }, ] as NavItem[] diff --git a/docs/.vuepress/notes.ts b/docs/.vuepress/notes.ts index 174f8d00..2f382634 100644 --- a/docs/.vuepress/notes.ts +++ b/docs/.vuepress/notes.ts @@ -2,45 +2,72 @@ import { definePlumeNotesConfig } from 'vuepress-theme-plume' export const zhNotes = definePlumeNotesConfig({ dir: 'notes', - link: '/note', + link: '/', notes: [ { - dir: 'vuepress-theme-plume', - link: '/vuepress-theme-plume/', + dir: 'theme/guide', + link: '/guide/', sidebar: [ - '', { - text: '指南', - icon: 'icon-park-outline:guide-board', - items: ['快速开始', '编写文章'], + text: '快速开始', + collapsed: false, + items: ['介绍', '安装与使用', '博客', '知识笔记'], }, { - text: '配置', + text: '写作', + collapsed: false, items: [ + '编写文章', { - text: '主题配置', - link: '主题配置', - items: ['主题插件配置', 'notes配置'], + text: 'markdown', + items: ['markdown-基础', 'markdown-扩展', 'markdown-进阶', 'markdown-试验性'], }, - '页面配置', + '国际化', ], }, { text: '功能', - items: ['基础功能', 'markdown增强'], + collapsed: false, + items: ['代码复制', '内容搜索', '评论', '加密', '组件', '友情链接页', 'seo', 'sitemap'], + }, + { + text: '自定义', + collapsed: false, + items: ['自定义首页', '自定义样式'], + }, + { + text: 'API', + collapsed: false, + items: ['api-客户端', 'api-node'], }, ], }, { - dir: 'vuepress-plugin', - link: '/vuepress-plugin/', + dir: 'theme/config', + link: '/config/', sidebar: [ - 'caniuse/README', { - dir: 'netlify-functions', - text: 'plugin-netlify-functions', - link: 'netlify-functions', - items: ['', '介绍', '使用', '功能', 'API', 'functions开发指南'], + text: '配置', + collapsed: false, + items: [ + '配置说明', + '多语言配置', + '主题配置', + '导航栏配置', + 'notes配置', + ], + }, + { + text: 'frontmatter', + dir: 'frontmatter', + collapsed: false, + items: ['basic', 'home', 'post', 'friend'], + }, + { + text: '内置插件', + dir: 'plugins', + collapsed: false, + items: ['', '代码复制', '代码高亮', '搜索', '阅读统计', 'markdown增强', '百度统计'], }, ], }, @@ -49,12 +76,6 @@ export const zhNotes = definePlumeNotesConfig({ export const enNotes = definePlumeNotesConfig({ dir: 'en/notes', - link: '/en/note', - notes: [ - { - dir: 'vuepress-plugin', - link: '/vuepress-plugin/', - sidebar: ['caniuse/README'], - }, - ], + link: '/', + notes: [], }) diff --git a/docs/.vuepress/public/CNAME b/docs/.vuepress/public/CNAME index ca1fd696..c0197bde 100644 --- a/docs/.vuepress/public/CNAME +++ b/docs/.vuepress/public/CNAME @@ -1 +1 @@ -pengzhanbo.cn +plume.pengzhanbo.cn diff --git a/docs/.vuepress/public/g.gif b/docs/.vuepress/public/g.gif deleted file mode 100644 index 6f89555c..00000000 Binary files a/docs/.vuepress/public/g.gif and /dev/null differ diff --git a/docs/.vuepress/public/images/1px-lines.png b/docs/.vuepress/public/images/1px-lines.png deleted file mode 100644 index 76b973bf..00000000 Binary files a/docs/.vuepress/public/images/1px-lines.png and /dev/null differ diff --git a/docs/.vuepress/public/images/bg-home.jpg b/docs/.vuepress/public/images/bg-home.jpg deleted file mode 100644 index f3ff127e..00000000 Binary files a/docs/.vuepress/public/images/bg-home.jpg and /dev/null differ diff --git a/docs/.vuepress/public/images/big-banner.jpg b/docs/.vuepress/public/images/big-banner.jpg deleted file mode 100644 index 70bf620c..00000000 Binary files a/docs/.vuepress/public/images/big-banner.jpg and /dev/null differ diff --git a/docs/.vuepress/public/images/blogger-fav.png b/docs/.vuepress/public/images/blogger-fav.png deleted file mode 100644 index 83adb8ab..00000000 Binary files a/docs/.vuepress/public/images/blogger-fav.png and /dev/null differ diff --git a/docs/.vuepress/public/images/blogger.jpg b/docs/.vuepress/public/images/blogger.jpg deleted file mode 100644 index a8e676a2..00000000 Binary files a/docs/.vuepress/public/images/blogger.jpg and /dev/null differ diff --git a/docs/.vuepress/public/images/blogger.png b/docs/.vuepress/public/images/blogger.png deleted file mode 100644 index 623dded5..00000000 Binary files a/docs/.vuepress/public/images/blogger.png and /dev/null differ diff --git a/docs/.vuepress/public/images/formative-demo-1.png b/docs/.vuepress/public/images/formative-demo-1.png deleted file mode 100644 index 1daf9586..00000000 Binary files a/docs/.vuepress/public/images/formative-demo-1.png and /dev/null differ diff --git a/docs/.vuepress/public/images/formative-demo-2.png b/docs/.vuepress/public/images/formative-demo-2.png deleted file mode 100644 index 3e4f0260..00000000 Binary files a/docs/.vuepress/public/images/formative-demo-2.png and /dev/null differ diff --git a/docs/.vuepress/public/images/formative-demo-3.png b/docs/.vuepress/public/images/formative-demo-3.png deleted file mode 100644 index 558976d1..00000000 Binary files a/docs/.vuepress/public/images/formative-demo-3.png and /dev/null differ diff --git a/docs/.vuepress/public/images/func-value-heap.png b/docs/.vuepress/public/images/func-value-heap.png deleted file mode 100644 index ee556d88..00000000 Binary files a/docs/.vuepress/public/images/func-value-heap.png and /dev/null differ diff --git a/docs/.vuepress/public/images/func-value-stack.png b/docs/.vuepress/public/images/func-value-stack.png deleted file mode 100644 index 3608b7a5..00000000 Binary files a/docs/.vuepress/public/images/func-value-stack.png and /dev/null differ diff --git a/docs/.vuepress/public/images/home-banner.jpg b/docs/.vuepress/public/images/home-banner.jpg deleted file mode 100644 index f81731a9..00000000 Binary files a/docs/.vuepress/public/images/home-banner.jpg and /dev/null differ diff --git a/docs/.vuepress/public/images/home-bg.jpg b/docs/.vuepress/public/images/home-bg.jpg deleted file mode 100644 index 95636186..00000000 Binary files a/docs/.vuepress/public/images/home-bg.jpg and /dev/null differ diff --git a/docs/.vuepress/public/images/jenkins_globalconfig.png b/docs/.vuepress/public/images/jenkins_globalconfig.png deleted file mode 100644 index 99861916..00000000 Binary files a/docs/.vuepress/public/images/jenkins_globalconfig.png and /dev/null differ diff --git a/docs/.vuepress/public/images/js-prototype-1.png b/docs/.vuepress/public/images/js-prototype-1.png deleted file mode 100644 index 4b8dcd5b..00000000 Binary files a/docs/.vuepress/public/images/js-prototype-1.png and /dev/null differ diff --git a/docs/.vuepress/public/images/js-prototype-2.png b/docs/.vuepress/public/images/js-prototype-2.png deleted file mode 100644 index c2f8c872..00000000 Binary files a/docs/.vuepress/public/images/js-prototype-2.png and /dev/null differ diff --git a/docs/.vuepress/public/images/js-prototype-3.png b/docs/.vuepress/public/images/js-prototype-3.png deleted file mode 100644 index 6d9556f3..00000000 Binary files a/docs/.vuepress/public/images/js-prototype-3.png and /dev/null differ diff --git a/docs/.vuepress/public/images/rust-untitled.png b/docs/.vuepress/public/images/rust-untitled.png deleted file mode 100644 index 20ae4417..00000000 Binary files a/docs/.vuepress/public/images/rust-untitled.png and /dev/null differ diff --git a/docs/.vuepress/public/images/viewport.jpg b/docs/.vuepress/public/images/viewport.jpg deleted file mode 100644 index f82f72e2..00000000 Binary files a/docs/.vuepress/public/images/viewport.jpg and /dev/null differ diff --git a/docs/.vuepress/public/images/viewport.png b/docs/.vuepress/public/images/viewport.png deleted file mode 100644 index 567375bf..00000000 Binary files a/docs/.vuepress/public/images/viewport.png and /dev/null differ diff --git a/docs/.vuepress/theme.ts b/docs/.vuepress/theme.ts index 81cb25f0..b74d20f0 100644 --- a/docs/.vuepress/theme.ts +++ b/docs/.vuepress/theme.ts @@ -4,20 +4,20 @@ import { enNotes, zhNotes } from './notes.js' import { enNavbar, zhNavbar } from './navbar.js' export const theme: Theme = themePlume({ - logo: 'https://pengzhanbo.cn/g.gif', - hostname: 'https://pengzhanbo.cn', + logo: '/plume.png', + hostname: 'https://plume.pengzhanbo.cn', repo: 'https://github.com/pengzhanbo/vuepress-theme-plume', docsDir: 'docs', avatar: { - url: '/images/blogger.jpg', + url: '/plume.png', name: 'Plume Theme', description: 'The Theme for Vuepress 2.0', }, - social: [{ icon: 'github', link: 'https://github.com/pengzhanbo' }], + social: [{ icon: 'github', link: 'https://github.com/pengzhanbo/vuepress-theme-plume' }], - footer: { copyright: 'Copyright © 2022-present pengzhanbo' }, + footer: { copyright: 'Copyright © 2021-present pengzhanbo' }, locales: { '/': { @@ -31,5 +31,27 @@ export const theme: Theme = themePlume({ }, plugins: { shiki: { twoslash: true }, + markdownEnhance: { + demo: true, + }, + comment: { + provider: 'Giscus', + comment: true, + repo: 'pengzhanbo/vuepress-theme-plume', + repoId: 'R_kgDOG_ebNA', + category: 'docs-comment', + categoryId: 'DIC_kwDOG_ebNM4Cd0uF', + mapping: 'url', + reactionsEnabled: true, + inputPosition: 'top', + darkTheme: 'dark_protanopia', + lightTheme: 'light_protanopia', + }, + + }, + encrypt: { + rules: { + '/article/enx7c9s/': '123456', + }, }, }) diff --git a/docs/1.前端/1.基础/BFC 块级格式化上下文.md b/docs/1.前端/1.基础/BFC 块级格式化上下文.md deleted file mode 100644 index 53d0f2d0..00000000 --- a/docs/1.前端/1.基础/BFC 块级格式化上下文.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -title: BFC 块级格式化上下文 -createTime: 2018/05/17 12:28:33 -permalink: /article/o5g7ggvf/ -author: pengzhanbo -tags: - - html ---- -## 概念 - -BFC, Block Formatting Context。是 W3C CSS2.1规范中的一个概念。 是页面中的一块块级渲染区域,并且有一套渲染规则,它决定了其子元素将如何定位,以及和其他元素的关系和作用。 - -具有BFC特性的元素,可以看做是一个被隔离了的独立容器,容器内的元素不会在布局上影响到外面的元素,并且BFC具有普通容器所没有的一些特性。 - -## 创建BFC的方式 - -1. 根元素(html) -2. 浮动元素,即 float值不为 none。 -3. 绝对定位元素, 元素的 position 为 absolute 或者 fixed -4. 行内块元素, 元素的 display 为 inline-block -5. 表格单元格, 元素的 display 为 table-cell。 (HTML表格单元格默认为该值) -6. 表格标题, 元素的display为table-caption。 (HTML表格标题默认为该值) -7. 匿名表格单元格元素, 元素的display为 table、table-row、table-row-group、table-header-group、table-footer-group 。 (分别是 HTML table、row、tbody、thead、tfoot的默认属性)或 inline-table。 -8. overflow计算值不为visible的块元素 -9. display值为 flow-root的元素 -10. contain值为 layout、content、paint的元素 -11. 弹性元素,display为 flex、inline-flex元素的直接子元素 -12. 网格元素, display为gird、inline-gird元素的直接子元素 -13. 多列容器,元素的column-count或column-width不为 auto, 包括column-count不为1 -14. colum-span为all的元素始终会创建一个新的BFC,即使该元素没有包裹在一个多列容器中。 - -## 作用 - -1. 同一个BFC的外边距会发生折叠(合并), 通过将其放在不同的BFC中规避折叠。 -2. BFC可以包含浮动元素,即清除浮动。 -3. BFC可以阻止元素被浮动元素覆盖。 diff --git a/docs/1.前端/1.基础/CSS at-rule.md b/docs/1.前端/1.基础/CSS at-rule.md deleted file mode 100644 index dbc6c1db..00000000 --- a/docs/1.前端/1.基础/CSS at-rule.md +++ /dev/null @@ -1,161 +0,0 @@ ---- -title: CSS At-Rules -createTime: 2018/10/06 08:16:38 -permalink: /article/btkqop1a/ -author: pengzhanbo -tags: - - css ---- - -## @charset - -#### 概述 -指定样式表中使用的字符编码。 它必须位于样式表中的第一个元素,且前面不得有任何字符。 - -不能在 ` -... -``` -加载字体文件,先尝试从用户本地加载,如果加载失败则从远程服务器下载: - -``` html -... - -... -``` -加载不同文件格式的字体,根据用户环境判断使用兼容的字体文件格式: -``` html -... - -... -``` - -## @import - -#### 概述 -从其他样式表导入样式规则。 - -`@import` 必须优先于其他类型的规则,即需要在文件顶部声明。`@charset` 除外。 - -#### 语法 -``` css -@import url; -@import url list-of-media-queries; -``` -- `url` 样式规则文件资源位置 -- `list-of-media-queries` [媒体查询](https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries),支持用逗号分隔多个查询条件。资源仅在满足媒体查询条件时才会被加载。 - - -## @keyframes - -#### 概述 -通过在动画序列中定义关键帧的样式来控制CSS动画序列中的中间步骤。 - -#### 示例 -使用 `from`,`to` 定义起始和结束关键帧的样式 实现动画 -``` css -@keyframes slidein { - from { - transform: translateX(0%); - } - - to { - transform: translateX(100%); - } -} -``` -使用 百分比 定义触发关键帧的时间点 -``` css -@keyframes slidein { - 0% { - transform: translateX(0%); - } - - 50% { - transform: translateX(50%); - } - - 100% { - transform: translateX(100%); - } -} -``` - -## @media - -媒体查询,详见 [CSS @media 媒体查询](/post/fe5ruia1/) diff --git a/docs/1.前端/1.基础/CSS media媒体查询.md b/docs/1.前端/1.基础/CSS media媒体查询.md deleted file mode 100644 index a489c01c..00000000 --- a/docs/1.前端/1.基础/CSS media媒体查询.md +++ /dev/null @@ -1,190 +0,0 @@ ---- -title: CSS 媒体查询 -createTime: 2018/08/18 08:43:02 -permalink: /article/fe5ruia1/ -author: pengzhanbo -tags: - - css ---- - -开发响应式网站时,常常需要使用到 media 媒体查询。这里总结下媒体查询的使用方法。 - -## 概述 -媒体查询是通过判断当前媒体是否满足 媒体查询规则,从而使其包含的 CSS规则生效。 - -从 CSS level 2 开始,就已经支持 `media-queries`,到 CSS level 3 以及之后的版本,媒体查询变得更加的丰富和能够适应更多的场景。 - -## 使用 - -媒体查询可以通过以下三种方式进行使用: - -#### 在 `` 元素引入CSS资源时,声明 `media` 属性 - -``` html - -``` - -#### 在` -``` - -#### 在`@import` 后 声明 媒体查询条件 -``` css -@import url('custom.css') screen and (min-width: 400px); -``` - -#### 在样式表中使用 At-Rule `@media` 使用媒体查询规则 -``` css -@media screen and (min-width: 400px) { - .example { - color: red; - } -} -``` - -### 语法 - -``` html - - - - - -``` - -## 媒体查询 [media-queries-list] - -`media-queries-list` 可以由以下三种内容组成: - -- `Media types` :媒体类型, 表示设备 -- `Media features` :媒体特性, 表示设备的状态 -- `Logical operators` : 逻辑操作符, 连接多个 `media-query` - -### Media types - -`Media types` 描述设备的一般类型。可以使用以下值: - -- `all`: 表示适用于所有设备。 默认值。 -- `print`: 表示 适用于在屏幕上以打印预览的模式查看页面和文档。 -- `screen`: 表示 适用于屏幕 。 - -> 在 *css2.1* 和 *Media Queries 3* 中还支持 `tty`,`tv`,`projection`,`handheld`,`braille`,`embossed`,`aural`,但这些值都已经在*Media Queries 4* 中被弃用。 - -### Media features - -媒体特性,描述 用户代理、输出设备以及环境的特定特征。 - -媒体特性表达式是完全是可选的,并且负责测试这些特性是否存在,值为多少。 且每个媒体特性表达式都必须使用括号括起来。 - -*以下仅列出比较常用到的媒体特性* - -- `width`: 视窗(viewport)的宽度,包括纵向滚动条的宽度。 - - 值的类型为 number,单位可以是 `px`、`em` 等。 - ``` css - with: 400px - ``` - -- `height`: 视窗(viewport)的高度。 - - 值的类型为 number,单位可以是 `px`、`em` 等。 - ``` css - height: 600px - ``` - -- `aspect-ratio`: 视窗(viewport)的宽高比。 - - 值的类型为 number/number。 - ``` css - aspect-ratio: 3/2 - ``` - -- `orientation`: 视窗(viewport) 的旋转方向。 - - portrait: 设备竖屏 - - landscape: 设备横屏 - ``` css - orientation: landscape - ``` -- `resolution`: 输出设备的分辨率 - - 值的类型为 number,单位为 `dpi`。 - ``` css - resolution: 320dpi - ``` - -- `scan`:输出设备的扫描过程(适用于电视机等)。 - -#### 媒体特性前缀 - -大部分的媒体特性均支持前缀,用于约束媒体特性的作用范围。 - -- `max-[media feature]`: 小于指定的最大值时,返回*true* -- `min-[media feature]`: 大于指定的最小值时,返回*true* - -*个人认为使用前缀时其表述稍显拗口,建议使用取值范围的方式声明表达式* - -#### 媒体特性语法 - -- 以键值对的形式,表述取固定的值 - ```` - ([media-feature-name]: [media-feature-value]) - ```` - -- 直接书写name, 表示值的结果为 boolean - ``` - ([media-feature-name]) - ``` - -- 表述 特性的取值范围 - - *声明 range 为描述数学符号 : '<' | '>' | '<=' | '>='* - - ``` - ([media-feature-name] [range] [media-feature-value]) - ([media-feature-name] [range] [media-feature-value] [range] [media-feature-value]) - ``` - - -### Logical operators - -逻辑操作符用于组成复合的 media queries。 - -- `and`: 用于合并多条`media query`, 且 每条 `media query` 均返回 *true* 时, - 媒体查询表达式的结果返回*true*。 -- `not`: 取反操作,使用`not [media query]`,当`media query` 返回 *false* 时, - 媒体查询表达式的结果返回*true*。 -- `,`: or操作符,组合多个 `media query`,任意一个`media query` 返回 *true*, - 媒体查询表达式的结果返回*true*。 -- `only`: 不支持更加高级的媒体类型的浏览器检测到only修饰的时候就会抛弃这个规则 - - - -## 使用示例详解 - -### 示例1: -``` css -@media screen and (width > 414px) {} -``` -当设备的屏幕视窗宽度大于414px时,应用CSS块中的样式规则。 - -### 示例2: -``` css -@media (width > 800px), screen and (orientation: landscape) {} -``` -当前设备 视窗宽度大于 800px, 或者设备方向为横向时,应用css块中的样式规则。 - -### 示例3: -``` css -@media screen and (414px < width < 800px) {} -``` -当前设备屏幕视窗宽度 大于 414px 且 小于 800px 时, 应用css块中的样式规则。 - diff --git a/docs/1.前端/1.基础/CSS选择器.md b/docs/1.前端/1.基础/CSS选择器.md deleted file mode 100644 index c8d129ad..00000000 --- a/docs/1.前端/1.基础/CSS选择器.md +++ /dev/null @@ -1,645 +0,0 @@ ---- -title: CSS选择器 -createTime: 2018/09/20 03:29:20 -permalink: /article/8vev8ixl/ -author: pengzhanbo -tags: - - css ---- - -## Basic Selectors 基础选择器 - -### Element selector -根据 element type 匹配 一组元素 -``` html -... - -... -

content

-... -``` - -### Class selector -根据 element 声明的 class属性值 匹配一组元素 -``` html -... - -... -

content

-... -``` - -### ID selector -根据 element 声明的 ID属性值,匹配一个元素(一个页面中,ID具有唯一性) -``` html -... - -... -

content

-... -``` - -### Universal selector -通配符,匹配所有 element -``` html -... - -... -

content

- span -... -``` - -## Attribute Selectors - -### \[attribute\] selector -匹配声明了该attribute的 一组 element -``` html -... - -... - content -... -``` - -### \[attribute="x"\] selector -匹配声明了该attribute,且值为 x 的一组 element -``` html -... - -... - abbr -... -``` - -### \[attribute~="x"\] selector -匹配声明了该attribute,且值包含了 单词 x 的一组 element -``` html -... - -... - abbr - -... -``` - -### \[attribute|="x"\] selector -匹配声明了该attribute,且值包含了一个 `x-` 开头的连字符拼接的词 的一组 element -``` html -... - -... - abbr - -... -``` - -### \[attribute^="x"\] selector -匹配声明了该attribute,且值是以 x 作为开头的 一组 element -``` html -... - -... - content -... -``` - -### \[attribute$="x"\] selector -匹配声明了该attribute,且值是以 x 作为结尾的 一组 element - -``` html -... - -... - content -... -``` - -### \[attribute*="x"\] selector -匹配声明了该attribute,且值包含了子串 x 的 一组 element - -``` html -... - -... - content -... -``` - -## Combinators 关系选择器 - -关系选择器适用于 任意选择器 的组合 - -### selector1 selector2 后代关系选择器 -匹配 selector1 的元素中,所有 selector2 的 元素 -``` html -... - -... -
- -

-
-... -``` - -### selector1 > selector2 子代关系选择器 -匹配 selector1 的下一级满足 selector2 的 一组元素 -``` html -... - -... -
- -

-
-... -``` - -### selector1 + selector2 相邻兄弟选择器 -匹配selector1后同级的紧跟的selector2的一个元素 -``` html -... - -... -

-

-

-

-... -``` - -### selector ~ selector2 一般兄弟选择器 -匹配selector1后同级的selector2的一组元素 -``` html -... - -... -

-

-

-

- -

-... -``` - -## Group Selectors 组合选择器 - -### selector1, selector2, ... -匹配用`,` 隔开的所有选择器 -``` html -... - -... -
- -

-
-... -``` - -## Pseudo-elements 伪元素选择器 - -### ::first-letter -匹配 element中的首个字符(字母、中文字、符号均可) -``` html -... - -... -

One

-... -``` - -### ::first-line -匹配 element中的首行文字 -``` html -... - -... -

- One Two
- Three -

-... -``` - -### ::before -和 `content` 属性一起使用,在匹配的元素内容之前生成的内容 - -``` html -... - -... -

- One Two -

-... -``` - -### ::after -和 `content` 属性一起使用,在匹配的元素内容之后生成的内容 - -``` html -... - -... -

- One Two -

-... -``` - -## Pseudo-classes 伪类选择器 - -### :link -匹配一个没有被访问过的链接 -``` html -... - -... - link -... -``` - -### :visited -匹配一个已访问过的链接 -``` html -... - -... - link -... -``` -### :active -匹配一个正在被激活的链接 -``` html -... - -... - link -... -``` - -### :hover -匹配一个被光标悬停的链接 -``` html -... - -... - link -... -``` -### :focus -匹配一个具有焦点的元素 -``` html -... - -... - -... -``` -### :target -匹配一个已被链接到的元素。 -例如通过``链接的head元素 -``` html -... - -... -

heading

-... -``` -### :first-child -匹配在同一个父元素内的的第一个子元素 -``` html -... - -... -

first child

-

second child

-... -``` -### :last-child -匹配在同一个父元素内的的最后一个子元素 -``` html -... - -... -

first child

-

last child

-... -``` -### :nth-child(n) -匹配在同一个父元素内的从上往下数的第N子个元素 -``` html -... - -... -

first child

-

second child

-... -``` -### :nth-last-child(n) -匹配在同一个父元素内的从下往上数的第N个子元素 -``` html -... - -... -

first child

-

second child

-... -``` -### :first-of-type -匹配在同一个父元素中的同类型的第一个元素 -``` html -... - -... -

first child

-

second child

-... -``` -### :last-of-type -匹配在同一个父元素中的同类型的最后一个元素 -``` html -... - -... -

first child

-

second child

-... -``` -### :nth-of-type(n) -匹配在同一个父元素中的同类型的从上往下数的第N个元素 -``` html -... - -... -

first child

-

second child

-... -``` -### :nth-last-of-type(n) -匹配在同一个父元素中的同类型的从下往上数的第N个元素 -``` html -... - -... -

first child

-

second child

-... -``` -### :only-child -如果元素是其父元素的唯一子元素,则匹配该元素 -``` html -... - -... -
-

only child

-
-... -``` -### :only-type -如果元素是其父元素的唯一的同类型的子元素,则匹配该元素 -``` html -... - -... -
-

only

- -
-... -``` -### :lang(lang) -匹配给定语言的元素 -``` html -... - -... -
-
This French quote has a nested quote inside.
-
-... -``` -### :empty -匹配没有子元素或内容的元素 -``` html -... - -... -
-
-
-... -``` -### :root -匹配文档的根元素, (即匹配的 ``元素) -### :enabled -匹配未被禁用的表单控件元素 -### :disabled -匹配被禁用的表单控件元素 -### :checked -匹配选中的单选或复选框类型的输入元素。 -### :not(selector) -协商伪类。匹配不匹配选择器的元素。 - -## 实验中的 Selectors - -这些选择器在某些浏览器中尚处于开发中,功能对应的标准文档可能被修改,在未来的版本中可能发生变化,谨慎使用。 - -### :any-link -匹配有链接锚点的元素,而不管元素是否被访问过。 -即会匹配每一个有 `href`属性的``,``,``的元素,匹配到所有的`:link`或`:visited`。 -``` html -... - -... - External link
- Internal target link
- Placeholder link (won't get styled) -... -``` -::: caniuse css-any-link -::: - -### :dir(dir) -如果元素的内容的书写方向是 dir , 则匹配该元素 - -*dir* : ltr | rtl - -``` html -... - -... -
- test1 -
test2 -
עִבְרִית
-
-
-... -``` -::: caniuse css-dir-pseudo -::: - -### :has(selector) -如果一个元素A恰好满足包含了selector 匹配的元素,则匹配元素A -``` html -... - -... - - -... -``` -::: caniuse css-has -::: - -### :is() / :any() -匹配一组选择器选中的元素。 - -优先级是由它的选择器列表中优先级最高的选择器决定。 - -``` html -... - -... - - -... -``` -::: caniuse css-matches-pseudo -::: - -### :where() -匹配一组选择器选中的元素。 - -:where() 的优先级总是为 0。 -``` html -... - -... - - -... -``` diff --git a/docs/1.前端/1.基础/DOCTYPE 文档类型声明.md b/docs/1.前端/1.基础/DOCTYPE 文档类型声明.md deleted file mode 100644 index 46d81447..00000000 --- a/docs/1.前端/1.基础/DOCTYPE 文档类型声明.md +++ /dev/null @@ -1,106 +0,0 @@ ---- -title: 文档类型声明 -createTime: 2018/03/14 01:06:52 -permalink: /article/s8udp6vp/ -author: pengzhanbo -tags: - - html ---- -Web世界中,随着历史的发展,技术的迭代,发展出了许多不同的文档,只有了解文档的类型,浏览器才能正确的解析渲染文档。 - - - -HTML也有多个不同的版本,只有完全明白页面使用的是哪个确切的HTML版本,浏览器才能完全正确的显示出HTML页面。 - -## 定义 - -`` 标签是一种标准通用标记语言的文档类型声明,目的是告诉标准通用标记语言解析器,它应该使用什么样的文档类型定义(DTD)来解析文档。 - -## 作用 - -声明文档的解析类型 (document.compatMode),避免浏览器的怪异模式。 - -__document.compatMode:__ - -- `BackCompat`: 怪异模式,浏览器使用自己的怪异模式解析渲染页面。 -- `CSS1Compat`: 标准模式,浏览器使用W3C的标准解析渲染页面。 - -## 使用 - -在文档的首行进行声明。必须位于 html标签之前。 - -`` 声明不是HTML标签,它是指示浏览器关于页面使用哪个HTML版本的指令。 - -> 如果页面没有 DOCTYPE 声明,那么默认是 怪异模式,为了确保浏览器按预期渲染页面,必须进行DOCTYPE声明。 - -### 常用的DOCTYPE声明 - -一般情况下,默认使用以下声明即可。 -``` html - - - -``` - -## 一般DOCTYPE声明列表 - -### html5 -``` html - -``` - -### HTML 4.01 Strict - -该 DTD 包含所有 HTML 元素和属性,但不包括展示性的和弃用的元素(比如 font)。不允许框架集(Framesets)。 -``` html - -``` - -### HTML 4.01 Transitional - -该 DTD 包含所有 HTML 元素和属性,包括展示性的和弃用的元素(比如 font)。不允许框架集(Framesets)。 -``` html - -``` - -### HTML 4.01 Frameset - -该 DTD 等同于 HTML 4.01 Transitional,但允许框架集内容。 -``` html - -``` - -### XHTML 1.0 Strict - -该 DTD 包含所有 HTML 元素和属性,但不包括展示性的和弃用的元素(比如 font)。不允许框架集(Framesets)。必须以格式正确的 XML 来编写标记。 -``` html - -``` -### XHTML 1.0 Transitional - -该 DTD 包含所有 HTML 元素和属性,包括展示性的和弃用的元素(比如 font)。不允许框架集(Framesets)。必须以格式正确的 XML 来编写标记。 - -```html - -``` - -### XHTML 1.0 Frameset - -该 DTD 等同于 XHTML 1.0 Transitional,但允许框架集内容。 - -```html - -``` - -### XHTML 1.1 - -该 DTD 等同于 XHTML 1.0 Strict,但允许添加模型(例如提供对东亚语系的 ruby 支持)。 - -``` html - -``` diff --git a/docs/1.前端/1.基础/HTML5新特性.md b/docs/1.前端/1.基础/HTML5新特性.md deleted file mode 100644 index 93f6c32f..00000000 --- a/docs/1.前端/1.基础/HTML5新特性.md +++ /dev/null @@ -1,273 +0,0 @@ ---- -title: HTML5新特性 -createTime: 2018/02/17 12:49:58 -permalink: /article/8rv45yuy/ -author: pengzhanbo -tags: - - html ---- - -## 语义标签 - -如 `
` `