From f8d7a075fa0b28b299e33c1bdc2a9d25dd668847 Mon Sep 17 00:00:00 2001 From: Yan Zhu Date: Sun, 20 May 2018 09:57:10 +0800 Subject: Move more Docs pages to Pug --- docs/src/contents/media.pug | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 docs/src/contents/media.pug (limited to 'docs/src/contents/media.pug') diff --git a/docs/src/contents/media.pug b/docs/src/contents/media.pug new file mode 100644 index 0000000..e69de29 -- cgit v1.3.1-26-gb76a From f7344f3e056a94640b6260ad7b7badfd33646c37 Mon Sep 17 00:00:00 2001 From: Yan Zhu Date: Sun, 3 Jun 2018 18:07:08 +0800 Subject: Update code and media docs to new Pug templates --- README.md | 2 +- docs/elements.html | 75 ++++++++++++++++++++++++++++++++++++++++++++- docs/src/contents/code.pug | 22 +++++++++++++ docs/src/contents/codes.pug | 0 docs/src/contents/media.pug | 73 +++++++++++++++++++++++++++++++++++++++++++ docs/src/elements.pug | 4 +-- 6 files changed, 172 insertions(+), 4 deletions(-) create mode 100644 docs/src/contents/code.pug delete mode 100644 docs/src/contents/codes.pug (limited to 'docs/src/contents/media.pug') diff --git a/README.md b/README.md index 711be7e..c5a47a8 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ You can compile your custom version of Spectre.css. Read [the documentation](htt - [Forms](https://picturepan2.github.io/spectre/elements.html#forms) - [Icons](https://picturepan2.github.io/spectre/elements.html#icons) - CSS only - [Labels](https://picturepan2.github.io/spectre/elements.html#labels) -- [Codes](https://picturepan2.github.io/spectre/elements.html#codes) +- [Code](https://picturepan2.github.io/spectre/elements.html#code) - [Media](https://picturepan2.github.io/spectre/elements.html#media) ### Layout diff --git a/docs/elements.html b/docs/elements.html index ae803f4..e7b4e82 100644 --- a/docs/elements.html +++ b/docs/elements.html @@ -1232,10 +1232,83 @@ <span class="label label-rounded label-primary">primary label</span>
-

Codes

+

Code

+

Code is used for styling inline and multiline code snippets.

+

For inline code, you can use the <code> element. + For multiline code snippet blocks, you can use <pre> with the code class as a container, and add <code> inside it. + The data-lang ibute is rendered as the language name in the top right. +

+
<!-- code snippets -->
+<button class="btn">
+  Submit
+</button>
+
+
<pre class="code" data-lang="HTML"><code><span class="com">&lt;!-- code snippets --&gt;</span>
+&lt;<span class="tag">button</span> <span class="atn">class</span>=<span class="atv">&quot;btn&quot;</span>&gt;
+  Submit
+&lt;<span class="tag">/button</span>&gt;
+</code></pre>

Media

+

Media includes responsive images, figures and video classes.

+

Images

+

Add the img-responsive class to <img> elements. The images will scale with the parent sizes.

+
+
macOS El Capitan Wallpaper
+
+

Add the img-fit-contain or img-fit-cover class to <img> or <video> elements. The media will crop itself to fit inside the element (and you don't need another container). + This feature can replace the classic background image trick. Microsoft Edge support is shipped with Build Number 16299+. +

+
+
+
macOS Yosemite Wallpaper +
img-fit-contain
+
+
+
+
macOS Yosemite Wallpaper +
img-fit-cover
+
+
+
+
<img src="img/osx-el-capitan.jpg" class="img-responsive ..." alt="...">
+<img src="img/osx-el-capitan.jpg" class="img-fit-contain ..." alt="...">
+<img src="img/osx-el-capitan.jpg" class="img-fit-cover ..." alt="...">
+
+

Figure

+

You can use the element <figure> for an image with a caption. + Add the figure class to <figure> element. + The images with the img-responsive class will be responsive. + And the included class figure-caption will provide basic style for caption. + Also, you can use text-left, text-center and text-right for caption alignment. +

+
+
+
macOS Yosemite Wallpaper +
macOS Yosemite wallpaper
+
+
+
+

Video

+

For responsive video, add a container with the video-responsive class. + Insert any YouTube, Youku or other iframe/embed video inside the container. + The ratio is 16:9 by default. + You may add video-responsive-4-3 for 4:3 ratio video container or video-responsive-1-1 for 1:1 ratio. +

+
+
+
+ +
+
+
+

For responsive <video> elements, you can add the video-responsive class directly.

+
<div class="video-responsive video-responsive-4-3">
+  <iframe src="..." width="..." height="..." frameborder="0" allowfullscreen></iframe>
+</div>
+
+<video class="video-responsive" src="...">...</video>
diff --git a/docs/src/contents/code.pug b/docs/src/contents/code.pug new file mode 100644 index 0000000..f1ee876 --- /dev/null +++ b/docs/src/contents/code.pug @@ -0,0 +1,22 @@ +p Code is used for styling inline and multiline code snippets. +p + | For inline code, you can use the #{''} element. + | For multiline code snippet blocks, you can use #{'
'} with the #[code code] class as a container, and add #{''} inside it.
+  | The #[code data-lang] ibute is rendered as the language name in the top right.
+
+pre.code(data-lang='HTML')
+  code
+    :highlight(lang="html")
+      
+      
+
+pre.code(data-lang='HTML')
+  code
+    :highlight(lang="html")
+      
<!-- code snippets -->
+      <button class="btn">
+        Submit
+      </button>
+      
\ No newline at end of file diff --git a/docs/src/contents/codes.pug b/docs/src/contents/codes.pug deleted file mode 100644 index e69de29..0000000 diff --git a/docs/src/contents/media.pug b/docs/src/contents/media.pug index e69de29..fcb8d36 100644 --- a/docs/src/contents/media.pug +++ b/docs/src/contents/media.pug @@ -0,0 +1,73 @@ +p Media includes responsive images, figures and video classes. + ++docs-subheading('media-images', 'Images') + +p + | Add the #[code img-responsive] class to #{''} elements. The images will scale with the parent sizes. + +.columns + .column.col-12 + img.img-responsive.rounded(src="img/osx-el-capitan.jpg" alt="macOS El Capitan Wallpaper") + +p + | Add the #[code img-fit-contain] or #[code img-fit-cover] class to #{''} or #{'
'} for an image with a caption. + | Add the #[code figure] class to #{'
'} element. + | The images with the #[code img-responsive] class will be responsive. + | And the included class #[code figure-caption] will provide basic style for caption. + | Also, you can use #[code text-left], #[code text-center] and #[code text-right] for caption alignment. + +.columns + .column.col-12 + figure.figure + img.img-responsive.rounded(src="img/osx-yosemite-2.jpg" alt="macOS Yosemite Wallpaper") + figcaption.figure-caption.text-center macOS Yosemite wallpaper + ++docs-subheading('media-video', 'Video') + +p + | For responsive video, add a container with the #[code video-responsive] class. + | Insert any YouTube, Youku or other iframe/embed video inside the container. + | The ratio is 16:9 by default. + | You may add #[code video-responsive-4-3] for 4:3 ratio video container or #[code video-responsive-1-1] for 1:1 ratio. + +.columns + .column.col-12 + .video-responsive + iframe(width="560" height="315" src="https://www.youtube.com/embed/7DbslbKsQSk" allowfullscreen="") + +p + | For responsive #{'

Accordions

Accordions are used to toggle sections of content.

-
+
@@ -239,7 +239,7 @@

Avatars

Avatars are user profile pictures.

-
+
Avatar XL
Avatar LG
@@ -264,7 +264,7 @@ Add the avatar class and avatar size class to <div> element. The data-initial attribute is the name appear inside the avatar.

-
+
AvatarAvatar
AvatarAvatar
@@ -290,7 +290,7 @@ <img src="img/avatar-1.png" alt="..."> </figure>
-
+
@@ -312,7 +312,7 @@

Badges

Badges are often used as unread number indicators.

-
+
Notifications
Notifications
Notifications
@@ -323,7 +323,7 @@ The badge will appear in the top-right direction of the element.

If there is no data-badge or the attribute is not specified, the badge will appear as a dot.

-
+
@@ -361,21 +361,17 @@ Bars represent the progress of a task or the value within the known range. Bars are custom components for displaying HTML5 <progress>, <meter> and input range elements.

-
+
-
-
-
-
25%
@@ -403,7 +399,7 @@ </div>

Slider bars

-
+
@@ -411,8 +407,6 @@
-
-
@@ -449,7 +443,7 @@