-
-
-
- | Class |
- Output |
- Responsive? |
-
-
-
- {% for size in atomics.width-percentage %}
-
- .{{ size.class }} |
- {{ size.output }} |
-
- {% if size.responsive %}
- {% icon "Checkmark", "fc-green-400" %}
- {% endif %}
- |
-
- {% endfor %}
-
-
-
- {% header "h3", "Fluid width examples" %}
-
-{% highlight html %}
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-{% endhighlight %}
-
-
-
-
-
- {% header "h2", "Static widths" %}
- Static widths are based on the full width of our 12-column grid. The grid is defined in rems, which are tied to the base font size. At the default font size, the full width is 1264px. A single column is approximately 105px.
- At the smallest breakpoint, our font size is reduced, and these static widths are therefore also reduced.
-
- {% header "h3", "Static width classes" %}
-
-
-
-
- | Class |
- Output |
- Responsive? |
-
-
-
- {% for size in atomics.width-static %}
-
- .{{ size.class }} |
- {{ size.output }} |
-
- {% if size.responsive %}
- {% icon "Checkmark", "fc-green-400" %}
- {% endif %}
- |
-
- {% endfor %}
-
-
-
-
- {% header "h3", "Static width examples" %}
-
-{% highlight html %}
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-{% endhighlight %}
-
-
-
-
-
- {% header "h2", "Max width" %}
- {% header "h3", "Max width classes" %}
-
-
-
-
- | Class |
- Output |
- Responsive? |
-
-
-
- {% for size in atomics.width-max %}
-
- .{{ size.class }} |
- {{ size.output }} |
-
- {% if size.responsive %}
- {% icon "Checkmark", "fc-green-400" %}
- {% endif %}
- |
-
- {% endfor %}
-
-
-
-
- {% header "h3", "Max width examples" %}
-
-{% highlight html %}
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-{% endhighlight %}
-
-
-
-
-
- {% header "h2", "Min width" %}
- {% header "h3", "Min width classes" %}
-
-
-
-
- | Class |
- Output |
- Responsive? |
-
-
-
- {% for size in atomics.width-min %}
-
- .{{ size.class }} |
- {{ size.output }} |
-
- {% if size.responsive %}
- {% icon "Checkmark", "fc-green-400" %}
- {% endif %}
- |
-
- {% endfor %}
-
-
-
-
- {% header "h3", "Min width examples" %}
-
-{% highlight html %}
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-{% endhighlight %}
-
-
-
-
-
- {% header "h2", "Height" %}
- {% header "h3", "Height classes" %}
- Height classes are provided at each fixed stop of our sizing scale.
-
-
-
-
- | Class |
- Output |
- Responsive? |
-
-
-
- {% for size in atomics.height %}
-
- .{{ size.class }} |
- {{ size.output }} |
-
- {% if size.responsive %}
- {% icon "Checkmark", "fc-green-400" %}
- {% endif %}
- |
-
- {% endfor %}
-
-
-
-
- {% header "h3", "Height examples" %}
-
-{% highlight html %}
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-
…
-{% endhighlight %}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {% header "h2", "Static Height" %}
- {% header "h3", "Static height classes" %}
-
-
-
-
- | Class |
- Output |
- Responsive? |
-
-
-
- {% for size in atomics.height-static %}
-
- .{{ size.class }} |
- {{ size.output }} |
-
- {% if size.responsive %}
- {% icon "Checkmark", "fc-green-400" %}
- {% endif %}
- |
-
- {% endfor %}
-
-
-
-
- {% header "h3", "Fluid height classes" %}
-
-
-
-
- | Class |
- Output |
- Responsive? |
-
-
-
- {% for size in atomics.height-percentage %}
-
- .{{ size.class }} |
- {{ size.output }} |
-
- {% if size.responsive %}
- {% icon "Checkmark", "fc-green-400" %}
- {% endif %}
- |
-
- {% endfor %}
-
-
-
-
-
-
- {% header "h2", "Min height" %}
- {% header "h3", "Min height classes" %}
-
-
-
-
- | Class |
- Output |
- Responsive? |
-
-
-
- {% for size in atomics.height-min %}
-
- .{{ size.class }} |
- {{ size.output }} |
-
- {% if size.responsive %}
- {% icon "Checkmark", "fc-green-400" %}
- {% endif %}
- |
-
- {% endfor %}
-
-
-
-
-
-
- {% header "h2", "Max height" %}
- {% header "h3", "Max height classes" %}
-
-
-
-
- | Class |
- Output |
- Responsive? |
-
-
-
- {% for size in atomics.height-max %}
-
- .{{ size.class }} |
- {{ size.output }} |
-
- {% if size.responsive %}
- {% icon "Checkmark", "fc-green-400" %}
- {% endif %}
- |
-
- {% endfor %}
-
-
-
diff --git a/packages/stacks-docs/product/base/width.html b/packages/stacks-docs/product/base/width.html
new file mode 100644
index 0000000000..5ac5929e5b
--- /dev/null
+++ b/packages/stacks-docs/product/base/width.html
@@ -0,0 +1,342 @@
+---
+layout: page
+title: Width
+description: Stacks provides atomic sizing classes for widths using pixel, rem, and percentage values. Most width classes are based on a 16px base font size and will scale based on the browser's font size.
+tags: base
+---
+
+
+ {% header "h2", "Pixel width" %}
+ Pixel width classes allow you to set the width of an element to a specific pixel value.
+
+ {% header "h3", "Pixel width classes" %}
+
+
+
+
+ | Class |
+ Computed value |
+ rem value |
+ Responsive? |
+
+
+
+ {% for size in atomics.sizing.px %}
+
+ .w{{ size.px }} |
+ width: {{ size.px }}px; |
+ {{ size.rem }}rem |
+
+ {% if size.responsive %}
+ {% icon "Checkmark", "fc-green-400" %}
+ {% endif %}
+ |
+
+ {% endfor %}
+
+
+
+
+ {% header "h3", "Pixel width examples" %}
+
+{% highlight html %}
+
…
+
…
+
…
+
…
+
…
+
…
+
…
+
…
+
…
+
…
+
…
+
…
+
…
+
…
+{% endhighlight %}
+
+ {% for size in atomics.sizing.px %}
+
+ {% endfor %}
+
+
+
+
+
+
+ {% header "h2", "Sizing units width" %}
+ Sizing units width classes allow you to set the width of an element according to a predefined set of 12 common values in used in Stacks.
+
+ {% header "h3", "Sizing units width classes" %}
+
+
+
+
+ | Class |
+ Computed value |
+ rem value |
+ Responsive? |
+
+
+
+ {% for size in atomics.sizing.sizing-units %}
+
+ .ws{{ size.level }} |
+ width: {{ size.px }}px; |
+ {{ size.rem }}rem |
+
+ {% if size.responsive %}
+ {% icon "Checkmark", "fc-green-400" %}
+ {% endif %}
+ |
+
+ {% endfor %}
+
+
+
+
+ {% header "h3", "Sizing units width examples" %}
+
+{% highlight html %}
+
…
+
…
+
…
+
…
+
…
+
…
+
…
+
…
+
…
+
…
+
…
+
…
+{% endhighlight %}
+
+ {% for size in atomics.sizing.sizing-units %}
+
+ {% endfor %}
+
+
+
+
+
+
+ {% header "h2", "Fluid width" %}
+ Fluid width classes allow you to set the width of an element to a percentage of the parent element's width or to the full width of the viewport.
+
+ {% header "h3", "Fluid width classes" %}
+
+
+
+
+ | Class |
+ Value |
+ Responsive? |
+
+
+
+ {% for size in atomics.sizing.percent %}
+
+ .w{{ size.percentage }} |
+ width: {{ size.percentage }}% |
+
+ {% if size.responsive %}
+ {% icon "Checkmark", "fc-green-400" %}
+ {% endif %}
+ |
+
+ {% endfor %}
+
+ .w-screen |
+ width: 100vw; |
+
+ {% icon "Checkmark", "fc-green-400" %}
+ |
+
+
+ .w-auto |
+ width: auto; |
+
+ {% icon "Checkmark", "fc-green-400" %}
+ |
+
+
+
+
+
+ {% header "h3", "Fluid width examples" %}
+
+{% highlight html %}
+
…
+
…
+
…
+
…
+
…
+
…
+
…
+
…
+
…
+
…
+
…
+
…
+
…
+
…
+{% endhighlight %}
+
+
+ {% for size in atomics.sizing.percent %}
+
+
+
.w{{ size.percentage }}
+
+
+ {% endfor %}
+
+
+
+
+
+
+
+ {% header "h2", "Min width" %}
+ Min width classes allow you to set the minimum width of an element.
+
+ {% header "h3", "Min width classes" %}
+
+
+
+
+ | Class |
+ Computed value |
+ rem value |
+ Responsive? |
+
+
+
+
+ .wmn0 |
+ min-width: 0; |
+ - |
+
+ {% icon "Checkmark", "fc-green-400" %}
+ |
+
+ {% for size in atomics.sizing.sizing-units %}
+
+ .wmn{{ size.level }} |
+ min-width: {{ size.px }}px; |
+ {{ size.rem }}rem |
+
+ {% if size.responsive %}
+ {% icon "Checkmark", "fc-green-400" %}
+ {% endif %}
+ |
+
+ {% endfor %}
+
+ {% assign percentItems = "25,50,75,100" %}
+ {% assign percentItems = percentItems | split: "," %}
+ {% for size in percentItems %}
+
+ .wmn{{ size }} |
+ min-width: {{ size }}%; |
+ - |
+
+ {% if size == "100" %}
+ {% icon "Checkmark", "fc-green-400" %}
+ {% endif %}
+ |
+
+ {% endfor %}
+
+ .wmn-screen |
+ min-width: 100vh; |
+ - |
+
+ {% icon "Checkmark", "fc-green-400" %}
+ |
+
+
+ .wmn-initial |
+ min-width: initial; |
+ - |
+
+ {% icon "Checkmark", "fc-green-400" %}
+ |
+
+
+
+
+
+
+
+
+ {% header "h2", "Max width" %}
+ Max width classes allow you to set the maximum width of an element.
+
+ {% header "h3", "Max width classes" %}
+
+
+
+
+ | Class |
+ Computed value |
+ rem value |
+ Responsive? |
+
+
+
+ {% for size in atomics.sizing.sizing-units %}
+
+ .wmx{{ size.level }} |
+ max-width: {{ size.px }}px; |
+ {{ size.rem }}rem |
+
+ {% if size.responsive %}
+ {% icon "Checkmark", "fc-green-400" %}
+ {% endif %}
+ |
+
+ {% endfor %}
+
+ {% assign percentItems = "25,50,75,100" %}
+ {% assign percentItems = percentItems | split: "," %}
+ {% for size in percentItems %}
+
+ .wmx{{ size }} |
+ max-width: {{ size }}%; |
+ - |
+
+ {% if size == "100" %}
+ {% icon "Checkmark", "fc-green-400" %}
+ {% endif %}
+ |
+
+ {% endfor %}
+
+
+ .wmx-screen |
+ max-width: 100vh; |
+ - |
+
+ {% icon "Checkmark", "fc-green-400" %}
+ |
+
+
+ .wmx-initial |
+ max-width: initial; |
+ - |
+
+ {% icon "Checkmark", "fc-green-400" %}
+ |
+
+
+
+
+
\ No newline at end of file