From 13a3c1e29473aa9f563e8db4ad94cb3eee9bdfe6 Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Tue, 5 Jun 2018 16:07:35 +0100 Subject: 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 --- scss/uikit/components/tile.scss | 224 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 224 insertions(+) create mode 100644 scss/uikit/components/tile.scss (limited to 'scss/uikit/components/tile.scss') diff --git a/scss/uikit/components/tile.scss b/scss/uikit/components/tile.scss new file mode 100644 index 00000000..3a364bfb --- /dev/null +++ b/scss/uikit/components/tile.scss @@ -0,0 +1,224 @@ +// Name: Tile +// Description: Component to create tiled boxes +// +// Component: `uk-tile` +// +// Modifiers: `uk-tile-xsmall` +// `uk-tile-small` +// `uk-tile-large` +// `uk-tile-xlarge` +// `uk-tile-default` +// `uk-tile-muted` +// `uk-tile-primary` +// `uk-tile-secondary` +// +// States: `uk-preserve-color` +// +// ======================================================================== + + +// Variables +// ======================================================================== + +$tile-padding-horizontal: 15px !default; +$tile-padding-horizontal-s: $global-gutter !default; +$tile-padding-horizontal-m: $global-medium-gutter !default; +$tile-padding-vertical: $global-medium-margin !default; +$tile-padding-vertical-m: $global-large-margin !default; + +$tile-xsmall-padding-vertical: $global-margin !default; + +$tile-small-padding-vertical: $global-medium-margin !default; + +$tile-large-padding-vertical: $global-large-margin !default; +$tile-large-padding-vertical-m: $global-xlarge-margin !default; + +$tile-xlarge-padding-vertical: $global-xlarge-margin !default; +$tile-xlarge-padding-vertical-m: ($global-large-margin + $global-xlarge-margin) !default; + +$tile-default-background: $global-background !default; + +$tile-muted-background: $global-muted-background !default; + +$tile-primary-background: $global-primary-background !default; +$tile-primary-color-mode: light !default; + +$tile-secondary-background: $global-secondary-background !default; +$tile-secondary-color-mode: light !default; + + +/* ======================================================================== + Component: Tile + ========================================================================== */ + +.uk-tile { + position: relative; + box-sizing: border-box; + padding-left: $tile-padding-horizontal; + padding-right: $tile-padding-horizontal; + padding-top: $tile-padding-vertical; + padding-bottom: $tile-padding-vertical; + @if(mixin-exists(hook-tile)) {@include hook-tile();} +} + +/* Phone landscape and bigger */ +@media (min-width: $breakpoint-small) { + + .uk-tile { + padding-left: $tile-padding-horizontal-s; + padding-right: $tile-padding-horizontal-s; + } + +} + +/* Tablet landscape and bigger */ +@media (min-width: $breakpoint-medium) { + + .uk-tile { + padding-left: $tile-padding-horizontal-m; + padding-right: $tile-padding-horizontal-m; + padding-top: $tile-padding-vertical-m; + padding-bottom: $tile-padding-vertical-m; + } + +} + +/* + * Micro clearfix + */ + +.uk-tile::before, +.uk-tile::after { + content: ""; + display: table; +} + +.uk-tile::after { clear: both; } + +/* + * Remove margin from the last-child + */ + +.uk-tile > :last-child { margin-bottom: 0; } + + +/* Size modifiers + ========================================================================== */ + +/* + * XSmall + */ + +.uk-tile-xsmall { + padding-top: $tile-xsmall-padding-vertical; + padding-bottom: $tile-xsmall-padding-vertical; +} + +/* + * Small + */ + +.uk-tile-small { + padding-top: $tile-small-padding-vertical; + padding-bottom: $tile-small-padding-vertical; +} + +/* + * Large + */ + +.uk-tile-large { + padding-top: $tile-large-padding-vertical; + padding-bottom: $tile-large-padding-vertical; +} + +/* Tablet landscape and bigger */ +@media (min-width: $breakpoint-medium) { + + .uk-tile-large { + padding-top: $tile-large-padding-vertical-m; + padding-bottom: $tile-large-padding-vertical-m; + } + +} + + +/* + * XLarge + */ + +.uk-tile-xlarge { + padding-top: $tile-xlarge-padding-vertical; + padding-bottom: $tile-xlarge-padding-vertical; +} + +/* Tablet landscape and bigger */ +@media (min-width: $breakpoint-medium) { + + .uk-tile-xlarge { + padding-top: $tile-xlarge-padding-vertical-m; + padding-bottom: $tile-xlarge-padding-vertical-m; + } + +} + + +/* Style modifiers + ========================================================================== */ + +/* + * Default + */ + +.uk-tile-default { + background: $tile-default-background; + @if(mixin-exists(hook-tile-default)) {@include hook-tile-default();} +} + +/* + * Muted + */ + +.uk-tile-muted { + background: $tile-muted-background; + @if(mixin-exists(hook-tile-muted)) {@include hook-tile-muted();} +} + +/* + * Primary + */ + +.uk-tile-primary { + background: $tile-primary-background; + @if(mixin-exists(hook-tile-primary)) {@include hook-tile-primary();} +} + +// Color Mode +@if ( $tile-primary-color-mode == light ) { .uk-tile-primary:not(.uk-preserve-color) { @extend .uk-light !optional;} } +@if ( $tile-primary-color-mode == dark ) { .uk-tile-primary:not(.uk-preserve-color) { @extend .uk-dark !optional;} } + +/* + * Secondary + */ + +.uk-tile-secondary { + background: $tile-secondary-background; + @if(mixin-exists(hook-tile-secondary)) {@include hook-tile-secondary();} +} + +// Color Mode +@if ( $tile-secondary-color-mode == light ) { .uk-tile-secondary:not(.uk-preserve-color) { @extend .uk-light !optional;} } +@if ( $tile-secondary-color-mode == dark ) { .uk-tile-secondary:not(.uk-preserve-color) { @extend .uk-dark !optional;} } + + +// Hooks +// ======================================================================== + +@if(mixin-exists(hook-tile-misc)) {@include hook-tile-misc();} + +// @mixin hook-tile(){} +// @mixin hook-tile-default(){} +// @mixin hook-tile-muted(){} +// @mixin hook-tile-primary(){} +// @mixin hook-tile-secondary(){} +// @mixin hook-tile-misc(){} -- cgit v1.2.3