Jelajahi Sumber

Documented visibility helpers

Angelos Chalaris 7 tahun lalu
induk
melakukan
ad84a02f63

+ 1 - 1
dist/mini-default.css

@@ -3,7 +3,7 @@
   Flavor name: Default (mini-default)
   Author: Angelos Chalaris (chalarangelo@gmail.com)
   Maintainers: Angelos Chalaris
-  mini.css version: v3.0.0-alpha.2
+  mini.css version: v3.0.0-alpha.3
 */
 /*
   Browsers resets and base typography.

+ 1 - 2
docs/build-docs.js

@@ -1,7 +1,6 @@
 var fs = require('fs');
 var version = require('./vinf');                            // Gets version info.
-var frameworkUrl = '"https://cdnjs.cloudflare.com/ajax/libs/mini.css/3.0.0-alpha.1/mini-default.css"';
-
+var frameworkUrl = `"https://cdnjs.cloudflare.com/ajax/libs/mini.css/${version.version.slice(1)}/mini-default.css"`;
 // INDEX
 
 var indexHtml = `<!DOCTYPE html>

+ 3 - 1
docs/doc-fragments/docFragments.js

@@ -23,6 +23,7 @@ var spoilersAndAccordions = require('./spoilersAndAccordions');
 var progressBars = require('./progressBars');
 var donutSpinners = require('./donutSpinners');
 var icons = require('./icons');
+var visibilityHelpers = require('./visibilityHelpers');
 
 module.exports = [
   gettingStarted,
@@ -33,5 +34,6 @@ module.exports = [
   tables,
   textHighlighting, toasts, tooltips, modalDialogs, spoilersAndAccordions,
   progressBars, donutSpinners,
-  icons
+  icons,
+  visibilityHelpers
 ]

+ 34 - 0
docs/doc-fragments/visibilityHelpers.js

@@ -0,0 +1,34 @@
+module.exports = {
+  id: 'visibility-helpers',
+  title: 'Visibility helpers',
+  keywords: ['hidden', 'visibility', 'visually-hidden', 'accessibility', 'utility'],
+  description: '<p>You can use visibility helper classes to hide elements for all users (<code>.hidden</code>) or for users not on screen readers (<code>.visually-hidden</code>). There are also responsive visibility helpers provided, for hiding or visually hiding content only for specific screen sizes (<code>.hidden-sm</code>, <code>.hidden-md</code>, <code>.hidden-lg</code> and <code>.visually-hidden-sm</code>, <code>.visually-hidden-md</code> and <code>.visually-hidden-lg</code> respectively).</p>',
+  example: '',
+  samples: [`<pre><span class="code-line"><span class="highlight-a">&lt;p</span> <span class="highlight-b">class</span>=<span class="highlight-c">&quot;hidden&quot;</span><span class="highlight-a">&gt;</span>Not visible for any users.<span class="highlight-a">&lt;/p&gt;</span></span>
+<span class="code-line"><span class="highlight-a">&lt;p</span> <span class="highlight-b">class</span>=<span class="highlight-c">&quot;visually-hidden&quot;</span><span class="highlight-a">&gt;</span>Visible only for screen readers.<span class="highlight-a">&lt;/p&gt;</span></span>
+<span class="code-line"><span class="highlight-a">&lt;p</span> <span class="highlight-b">class</span>=<span class="highlight-c">&quot;hidden-sm&quot;</span><span class="highlight-a">&gt;</span>Not visible for users on screens under 768px wide.<span class="highlight-a">&lt;/p&gt;</span></span>
+<span class="code-line"><span class="highlight-a">&lt;p</span> <span class="highlight-b">class</span>=<span class="highlight-c">&quot;hidden-md&quot;</span><span class="highlight-a">&gt;</span>Not visible for users on screens 768px-1280px wide.<span class="highlight-a">&lt;/p&gt;</span></span>
+<span class="code-line"><span class="highlight-a">&lt;p</span> <span class="highlight-b">class</span>=<span class="highlight-c">&quot;hidden-lg&quot;</span><span class="highlight-a">&gt;</span>Not visible for users on screens wider than 1280px.<span class="highlight-a">&lt;/p&gt;</span></span>
+<span class="code-line"><span class="highlight-a">&lt;p</span> <span class="highlight-b">class</span>=<span class="highlight-c">&quot;visually-hidden-sm&quot;</span><span class="highlight-a">&gt;</span>Visible only for screen readers under 768px wide.<span class="highlight-a">&lt;/p&gt;</span></span>
+<span class="code-line"><span class="highlight-a">&lt;p</span> <span class="highlight-b">class</span>=<span class="highlight-c">&quot;visually-hidden-md&quot;</span><span class="highlight-a">&gt;</span>Visible only for screen readers 768px-1280px wide.<span class="highlight-a">&lt;/p&gt;</span></span>
+<span class="code-line"><span class="highlight-a">&lt;p</span> <span class="highlight-b">class</span>=<span class="highlight-c">&quot;visually-hidden-lg&quot;</span><span class="highlight-a">&gt;</span>Visible only for screen readers wider than 1280px.<span class="highlight-a">&lt;/p&gt;</span></span></pre>`],
+  notes: [
+    'Visibility helpers use <code>!important</code> declarations to override any other styles, so exercise caution when using them.',
+    'The specific breakpoints for small, medium and large screen sizes are as follows:<ul><li>small: less than <code>768px</code> wide</li><li>medium: more than or equal to <code>768px</code> wide and less than <code>1280px</code> wide</li><li>large: <code>1280px</code> wide or more</li></ul>',
+    'Responsive visibility helper classes are independent, meaning that hiding or visually hiding an element in one screen size will not affect its visibility in any other screen size.'
+  ],
+  customization: [],
+  modifiers: [],
+  dos: [
+    {
+      description: `You can apply multiple responsive visibility helpers on the same element.`,
+      sample: `<pre><span class="code-line"><span class="highlight-a">&lt;p</span> <span class="highlight-b">class</span>=<span class="highlight-c">&quot;hidden-sm hidden-md&quot;</span><span class="highlight-a">&gt;</span>Not visible for users on screens under 1280px wide.<span class="highlight-a">&lt;/p&gt;</span></span></pre>`
+    }
+  ],
+  donts: [
+    {
+      description: `Avoid combining <code>.hidden</code> and <code>.visually-hidden</code> or responsive helpers for the same screen size.`,
+      sample: `<pre><span class="code-line"><span class="highlight-a">&lt;p</span> <span class="highlight-b">class</span>=<span class="highlight-c">&quot;hidden visually-hidden&quot;</span><span class="highlight-a">&gt;</span>Do not do this.<span class="highlight-a">&lt;/p&gt;</span></span></pre>`
+    }
+  ]
+}

+ 4 - 0
docs/v3/DEVLOG.md

@@ -297,3 +297,7 @@
 
 - Updated `icon` module to have the variables definitions in comments (in case of standalone use).
 - Documented `icon` module in its entirety and retested everything. It's all good.
+
+## 20180129
+
+- Documented visibility helpers.

File diff ditekan karena terlalu besar
+ 0 - 1
docs/v3/docs.html


+ 1 - 1
docs/v3/index.html

@@ -19,7 +19,7 @@
     <div class="index-splash-image"></div>
     <h1 class="splash">mini<small>.css</small></h1>
     <p class="splash">minimal, responsive, style-agnostic <br>CSS framework</p>
-    <p id="version-info">v3.0.0-alpha.2</p>
+    <p id="version-info">v3.0.0-alpha.3</p>
     <a class="button splash" href="docs">Get started</a>
   </div>
   <header class="row sticky">

+ 1 - 1
docs/vinf.js

@@ -1,4 +1,4 @@
 // Get the current version of the Gluon branch.
 module.exports = {
-  version: 'v3.0.0-alpha.2'
+  version: 'v3.0.0-alpha.3'
 }

+ 1 - 1
src/flavors/mini-default.scss

@@ -5,7 +5,7 @@
   Flavor name: Default (mini-default)
   Author: Angelos Chalaris (chalarangelo@gmail.com)
   Maintainers: Angelos Chalaris
-  mini.css version: v3.0.0-alpha.2
+  mini.css version: v3.0.0-alpha.3
 */
 @import '../mini/core';
 @import '../mini/layout';

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini