aboutsummaryrefslogtreecommitdiffstats
path: root/scss/uikit/components/container.scss
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-06-05 16:07:35 +0100
committerGravatar GitHub <[email protected]>2018-06-05 16:07:35 +0100
commit13a3c1e29473aa9f563e8db4ad94cb3eee9bdfe6 (patch)
tree290c6d668ec9161a39065456a33ec634215907cc /scss/uikit/components/container.scss
parentdocumentation metadata API (#57) (diff)
Move from CSS to SCSS (#86)
* Rewrite existing style.css with sass * Add "uses-rst" class for pages that use rendered RST This replaces the previous method of just listing every page in the sass * Remove old debug print * Mixins and error pages * Newly built CSS * Add SASS cache to .gitignore * New error SASS * Slight changes to error template * Add UIKit SCSS to repo This includes the LICENSE and our customizations, which makes life way easier for contributors * Reorganize sass folder; your watchers can avoid uikit now * Sass folder should be called scss * Change variable names * [SCSS] Linting * Fix scss_lint gem name [ci skip] * [SCSS] Now you can compile with just Python! * Temporary hack to make the wiki editor taller * [SCSS] @jchristgit * [SCSS.py] Require specification of include dir to simplify the SCSS imports * [SCSS] All inline styles have been removed * [SCSS] Update UIKit theme to import from our variables * [SCSS] Remove extra newlines in errors/_common.scss
Diffstat (limited to 'scss/uikit/components/container.scss')
-rw-r--r--scss/uikit/components/container.scss106
1 files changed, 106 insertions, 0 deletions
diff --git a/scss/uikit/components/container.scss b/scss/uikit/components/container.scss
new file mode 100644
index 00000000..c518d6d7
--- /dev/null
+++ b/scss/uikit/components/container.scss
@@ -0,0 +1,106 @@
+// Name: Container
+// Description: Component to align and center your site and grid content
+//
+// Component: `uk-container`
+//
+// Modifier: `uk-container-small`
+// `uk-container-large`
+// `uk-container-expand`
+//
+// ========================================================================
+
+
+// Variables
+// ========================================================================
+
+$container-max-width: 1200px !default;
+$container-small-max-width: 900px !default;
+$container-large-max-width: 1600px !default;
+
+$container-padding-horizontal: 15px !default;
+$container-padding-horizontal-s: $global-gutter !default;
+$container-padding-horizontal-m: $global-medium-gutter !default;
+
+
+/* ========================================================================
+ Component: Container
+ ========================================================================== */
+
+/*
+ * 1. Box sizing has to be `content-box` so the max-width is always the same and
+ * unaffected by the padding on different breakpoints. It's important for the size modifiers.
+ */
+
+.uk-container {
+ box-sizing: content-box; /* 1 */
+ max-width: $container-max-width;
+ margin-left: auto;
+ margin-right: auto;
+ padding-left: $container-padding-horizontal;
+ padding-right: $container-padding-horizontal;
+}
+
+/* Phone landscape and bigger */
+@media (min-width: $breakpoint-small) {
+
+ .uk-container {
+ padding-left: $container-padding-horizontal-s;
+ padding-right: $container-padding-horizontal-s;
+ }
+
+}
+
+/* Tablet landscape and bigger */
+@media (min-width: $breakpoint-medium) {
+
+ .uk-container {
+ padding-left: $container-padding-horizontal-m;
+ padding-right: $container-padding-horizontal-m;
+ }
+
+}
+
+/*
+ * Micro clearfix
+ */
+
+.uk-container::before,
+.uk-container::after {
+ content: "";
+ display: table;
+}
+
+.uk-container::after { clear: both; }
+
+/*
+ * Remove margin from the last-child
+ */
+
+.uk-container > :last-child { margin-bottom: 0; }
+
+/*
+ * Remove padding from nested containers
+ */
+
+.uk-container .uk-container {
+ padding-left: 0;
+ padding-right: 0;
+}
+
+
+/* Size modifier
+ ========================================================================== */
+
+.uk-container-small { max-width: $container-small-max-width; }
+
+.uk-container-large { max-width: $container-large-max-width; }
+
+.uk-container-expand { max-width: none; }
+
+
+// Hooks
+// ========================================================================
+
+@if(mixin-exists(hook-container-misc)) {@include hook-container-misc();}
+
+// @mixin hook-container-misc(){} \ No newline at end of file