first commit

This commit is contained in:
armansansd
2023-07-12 16:31:19 +01:00
commit 3424b1927b
23306 changed files with 2217776 additions and 0 deletions
+176
View File
@@ -0,0 +1,176 @@
// Foundation for Sites by ZURB
// foundation.zurb.com
// Licensed under MIT Open Source
////
/// @group grid
////
/// Outputs CSS classes for the grid.
/// @access private
@mixin foundation-grid(
$row: 'row',
$column: 'column',
$column-row: 'column-row',
$gutter: 'gutter',
$push: 'push',
$pull: 'pull',
$center: 'centered',
$uncenter: 'uncentered',
$collapse: 'collapse',
$uncollapse: 'uncollapse',
$offset: 'offset',
$end: 'end',
$expanded: 'expanded',
$block: 'block'
) {
// Row
.#{$row} {
@include grid-row;
// Collapsing
&.#{$collapse} {
> .#{$column} {
@include grid-col-collapse;
}
}
// Nesting
& .#{$row} {
@include grid-row-nest($grid-column-gutter);
&.#{$collapse} {
margin-right: 0;
margin-left: 0;
}
}
// Expanded (full-width) row
&.#{$expanded} {
@include grid-row-size(expand);
.#{$row} {
margin-right: auto;
margin-left: auto;
}
}
&:not(.#{$expanded}) .#{$row} {
@include grid-row-size(expand);
}
@if type-of($grid-column-gutter) == 'map' {
// Static (unresponsive) row gutters
//
@each $breakpoint, $value in $grid-column-gutter {
&.#{$gutter}-#{$breakpoint} {
> .#{$column} {
@include grid-col-gutter($value);
}
}
}
}
}
// Column
.#{$column} {
@include grid-col;
@if $grid-column-align-edge {
&.#{$end} {
@include grid-col-end;
}
}
}
// Column row
// The double .row class is needed to bump up the specificity
.#{$column}.#{$row}.#{$row} {
float: none;
}
// To properly nest a column row, padding and margin is removed
.#{$row} .#{$column}.#{$row}.#{$row} {
margin-right: 0;
margin-left: 0;
padding-right: 0;
padding-left: 0;
}
@include -zf-each-breakpoint {
@for $i from 1 through $grid-column-count {
// Column width
.#{$-zf-size}-#{$i} {
@include grid-col-size($i);
}
// Source ordering
@if $i < $grid-column-count {
.#{$-zf-size}-#{$push}-#{$i} {
@include grid-col-pos($i);
}
.#{$-zf-size}-#{$pull}-#{$i} {
@include grid-col-pos(-$i);
}
}
// Offsets
$o: $i - 1;
.#{$-zf-size}-#{$offset}-#{$o} {
@include grid-col-off($o);
}
}
// Block grid
@for $i from 1 through $block-grid-max {
.#{$-zf-size}-up-#{$i} {
@include grid-layout($i, '.#{$column}');
}
}
// Responsive collapsing
.#{$-zf-size}-#{$collapse} {
> .#{$column} { @include grid-col-collapse; }
.#{$row} {
margin-right: 0;
margin-left: 0;
}
}
.#{$expanded}.#{$row} .#{$-zf-size}-#{$collapse}.#{$row} {
margin-right: 0;
margin-left: 0;
}
.#{$-zf-size}-#{$uncollapse} {
> .#{$column} { @include grid-col-gutter($-zf-size); }
}
// Positioning
.#{$-zf-size}-#{$center} {
@include grid-col-pos(center);
}
// Gutter adjustment
.#{$-zf-size}-#{$uncenter},
.#{$-zf-size}-#{$push}-0,
.#{$-zf-size}-#{$pull}-0 {
@include grid-col-unpos;
}
}
// Block grid columns
.#{$column}-#{$block} {
@include grid-column-margin;
}
@if $column == 'column' and has-value($grid-column-alias) {
.#{$grid-column-alias} {
// sass-lint:disable-block placeholder-in-extend
@extend .column;
}
}
}
+108
View File
@@ -0,0 +1,108 @@
// Foundation for Sites by ZURB
// foundation.zurb.com
// Licensed under MIT Open Source
////
/// @group grid
////
/// Calculates the width of a column based on a number of factors.
///
/// @param {Number|List} $columns
/// Width of the column. Accepts multiple values:
/// - A percentage value will make the column that exact size.
/// - A single digit will make the column span that number of columns wide, taking into account the column count of the parent row.
/// - A list of the format "x of y" (without quotes) will make a column that is *x* columns wide, assuming *y* total columns for the parent.
///
/// @returns {Number} A calculated percentage value.
@function grid-column($columns) {
$width: 0%;
// Parsing percents, decimals, and column counts
@if type-of($columns) == 'number' {
@if unit($columns) == '%' {
$width: $columns;
}
@else if $columns < 1 {
$width: percentage($columns);
}
@else {
$width: percentage($columns / $grid-column-count);
}
}
// Parsing "n of n" expressions
@else if type-of($columns) == 'list' {
@if length($columns) != 3 {
@error 'Wrong syntax for grid-column(). Use the format "n of n".';
}
@else {
$width: percentage(nth($columns, 1) / nth($columns, 3));
}
}
// Anything else is incorrect
@else {
@error 'Wrong syntax for grid-column(). Use a number, decimal, percentage, or "n of n".';
}
@return $width;
}
/// Creates a grid column.
///
/// @param {Mixed} $columns [$grid-column-count] - Width of the column. Refer to the `grid-column()` function to see possible values.
/// @param {Mixed} $gutters [$grid-column-gutter] - Spacing between columns. Refer to the `grid-column-gutter()` function to see possible values.
@mixin grid-column(
$columns: $grid-column-count,
$gutters: $grid-column-gutter
) {
@include grid-column-size($columns);
float: $global-left;
// Gutters
@include grid-column-gutter($gutters: $gutters);
// Position
@include grid-col-pos(auto);
}
/// Creates a grid column row. This is the equivalent of adding `.row` and `.column` to the same element.
///
/// @param {Mixed} $gutters [$grid-column-gutter] - Width of the gutters on either side of the column row. Refer to the `grid-column-gutter()` function to see possible values.
@mixin grid-column-row(
$gutters: $grid-column-gutter
) {
@include grid-row;
@include grid-column($gutters: $gutters);
&,
&:last-child {
float: none;
}
}
/// Shorthand for `grid-column()`.
/// @alias grid-column
@function grid-col(
$columns: $grid-column-count
) {
@return grid-column($columns);
}
/// Shorthand for `grid-column()`.
/// @alias grid-column
@mixin grid-col(
$columns: $grid-column-count,
$gutters: $grid-column-gutter
) {
@include grid-column($columns, $gutters);
}
/// Shorthand for `grid-column-row()`.
/// @alias grid-column-row
@mixin grid-col-row(
$gutters: $grid-column-gutter
) {
@include grid-column-row($gutters);
}
+260
View File
@@ -0,0 +1,260 @@
// Foundation for Sites by ZURB
// foundation.zurb.com
// Licensed under MIT Open Source
////
/// @group flex-grid
////
/// Creates a container for a flex grid row.
///
/// @param {Keyword|List} $behavior [null]
/// Modifications to the default grid styles. `nest` indicates the row will be placed inside another row. `collapse` indicates that the columns inside this row will not have padding. `nest collapse` combines both behaviors.
/// @param {Keyword|Number} $size [$grid-row-width] Maximum size of the row. Set to `expand` to make the row taking the full width.
/// @param {Number} $columns [null] - Number of columns to use for this row. If set to `null` (the default), the global column count will be used.
/// @param {Boolean} $base [true] - Set to `false` to prevent basic styles from being output. Useful if you're calling this mixin on the same element twice, as it prevents duplicate CSS output.
/// @param {Boolean} $wrap [true] - Set to `false` to have row wrapping behavior set to nowrap
/// @param {Number|Map} $gutters [$grid-column-gutter] - Gutter map or single value to use when inverting margins, in case the row is nested. Responsive gutter settings by default.
@mixin flex-grid-row(
$behavior: null,
$size: $grid-row-width,
$columns: null,
$base: true,
$wrap: true,
$gutters: $grid-column-gutter
) {
$margin: auto;
$wrap: if($wrap, wrap, nowrap);
@if index($behavior, nest) != null {
@include grid-row-nest($gutters);
@if index($behavior, collapse) != null {
margin-right: 0;
margin-left: 0;
}
}
@else {
@include grid-row-size($size);
margin-right: auto;
margin-left: auto;
}
@if $base {
display: flex;
flex-flow: row $wrap;
}
@if $columns != null {
@include grid-context($columns, $base) {
@content;
}
}
}
/// Calculates the `flex` property for a flex grid column. It accepts all of the same values as the basic `grid-column()` function, along with two extras:
/// - `expand` (the default) will make the column expand to fill space.
/// - `shrink` will make the column contract, so it only takes up the horizontal space it needs.
///
/// @param {Mixed} $columns [expand] - Width of the column.
@function flex-grid-column($columns: expand) {
$flex: 1 1 0px; // sass-lint:disable-line zero-unit
@if $columns == shrink {
$flex: 0 0 auto;
}
@else if $columns != expand {
$flex: 0 0 grid-column($columns);
}
@return $flex;
}
/// Creates a column for a flex grid. By default, the column will stretch to the full width of its container, but this can be overridden with sizing classes, or by using the `unstack` class on the parent flex row.
///
/// @param {Mixed} $columns [expand] - Width of the column. Refer to the `flex-grid-column()` function to see possible values.
/// @param {Number|Map} $gutters [$grid-column-gutter] - Map or single value for gutters width. See the `grid-column-gutter` mixin.
@mixin flex-grid-column(
$columns: expand,
$gutters: $grid-column-gutter
) {
// Base properties
@include flex-grid-size($columns);
// Gutters
@include grid-column-gutter($gutters: $gutters);
// fixes recent Chrome version not limiting child width
// https://stackoverflow.com/questions/34934586/white-space-nowrap-and-flexbox-did-not-work-in-chrome
@if $columns == expand {
min-width: 0;
}
}
/// Creates a block grid for a flex grid row.
///
/// @param {Number} $n - Number of columns to display on each row.
/// @param {String} $selector - Selector to use to target columns within the row.
@mixin flex-grid-layout(
$n,
$selector: '.column'
) {
flex-wrap: wrap;
> #{$selector} {
$pct: percentage(1/$n);
flex: 0 0 $pct;
max-width: $pct;
}
}
/// Changes the width flex grid column.
/// @param {Mixed} $columns [expand] - Width of the column. Refer to the `flex-grid-column()` function to see possible values.
@mixin flex-grid-size($columns: null) {
$columns: $columns or expand;
flex: flex-grid-column($columns);
// max-width fixes IE 10/11 not respecting the flex-basis property
@if $columns != expand and $columns != shrink {
max-width: grid-column($columns);
}
}
@mixin foundation-flex-grid {
// Row
.row {
@include flex-grid-row;
// Nesting behavior
& .row {
@include flex-grid-row(nest, $base: false);
&.collapse {
margin-right: 0;
margin-left: 0;
}
}
// Expanded row
&.expanded {
@include grid-row-size(expand);
.row {
margin-right: auto;
margin-left: auto;
}
}
&:not(.expanded) .row {
@include grid-row-size(expand);
}
&.collapse {
> .column {
@include grid-col-collapse;
}
}
// Undo negative margins
// From collapsed child
&.is-collapse-child,
&.collapse > .column > .row {
margin-right: 0;
margin-left: 0;
}
}
// Column
.column {
@include flex-grid-column;
}
// Column row
// The double .row class is needed to bump up the specificity
.column.row.row {
float: none;
display: block;
}
// To properly nest a column row, padding and margin is removed
.row .column.row.row {
margin-right: 0;
margin-left: 0;
padding-right: 0;
padding-left: 0;
}
@include -zf-each-breakpoint {
@for $i from 1 through $grid-column-count {
// Sizing (percentage)
.#{$-zf-size}-#{$i} {
flex: flex-grid-column($i);
max-width: grid-column($i);
}
// Offsets
$o: $i - 1;
.#{$-zf-size}-offset-#{$o} {
@include grid-column-offset($o);
}
}
// Block grid
@for $i from 1 through $block-grid-max {
.#{$-zf-size}-up-#{$i} {
@include flex-grid-layout($i);
}
}
@if $-zf-size != $-zf-zero-breakpoint {
// Sizing (expand)
@include breakpoint($-zf-size) {
.#{$-zf-size}-expand {
flex: flex-grid-column();
}
}
// Auto-stacking/unstacking
@at-root (without: media) {
.row.#{$-zf-size}-unstack {
> .column {
flex: flex-grid-column(100%);
@include breakpoint($-zf-size) {
flex: flex-grid-column();
}
}
}
}
}
// Responsive collapsing
.#{$-zf-size}-collapse {
> .column { @include grid-col-collapse; }
}
.#{$-zf-size}-uncollapse {
> .column { @include grid-col-gutter($-zf-size); }
}
}
// Sizing (shrink)
.shrink {
flex: flex-grid-column(shrink);
max-width: 100%;
}
// Block grid columns
.column-block {
@include grid-column-margin;
}
.columns {
@extend .column; // sass-lint:disable-line placeholder-in-extend
}
}
+48
View File
@@ -0,0 +1,48 @@
// Foundation for Sites by ZURB
// foundation.zurb.com
// Licensed under MIT Open Source
////
/// @group grid
////
/// The maximum width of a row.
/// @type Number
$grid-row-width: $global-width !default;
/// The default column count of a grid. Changing this value affects the logic of the grid mixins, and the number of CSS classes output.
/// @type Number
$grid-column-count: 12 !default;
/// The amount of space between columns at different screen sizes. To use just one size, set the variable to a number instead of a map.
/// @type Map | Length
/// @since 6.1.0
$grid-column-gutter: (
small: 20px,
medium: 30px,
) !default;
/// If `true`, the last column in a row will align to the opposite edge of the row.
/// @type Boolean
$grid-column-align-edge: true !default;
/// Selector used for an alias of column (with @extend). If `false`, no alias is created.
/// @type String
$grid-column-alias: 'columns' !default;
/// The highest number of `.x-up` classes available when using the block grid CSS.
/// @type Number
$block-grid-max: 8 !default;
// Internal value to store the end column float direction
$-zf-end-float: if($grid-column-align-edge, $global-right, $global-left);
@import 'row';
@import 'column';
@import 'size';
@import 'position';
@import 'gutter';
@import 'classes';
@import 'layout';
@import 'flex-grid';
+67
View File
@@ -0,0 +1,67 @@
// Foundation for Sites by ZURB
// foundation.zurb.com
// Licensed under MIT Open Source
////
/// @group grid
////
/// Set the gutters on a column
/// @param {Number|Keyword} $gutter [auto]
/// Spacing between columns, accepts multiple values:
/// - A single value will make the gutter that exact size.
/// - A breakpoint name will make the gutter the corresponding size in the $gutters map.
/// - "auto" will make the gutter responsive, using the $gutters map values.
/// @param {Number|Map} $gutters [$grid-column-gutter] - Gutter map or single value to use. Responsive gutter settings by default.
@mixin grid-column-gutter(
$gutter: auto,
$gutters: $grid-column-gutter
) {
@include -zf-breakpoint-value($gutter, $gutters) {
$padding: rem-calc($-zf-bp-value) / 2;
padding-right: $padding;
padding-left: $padding;
}
}
/// Collapse the gutters on a column by removing the padding. **Note:** only use this mixin within a breakpoint. To collapse a column's gutters on all screen sizes, use the `$gutter` parameter of the `grid-column()` mixin instead.
@mixin grid-column-collapse {
@include grid-column-gutter(0);
}
/// Shorthand for `grid-column-gutter()`.
/// @alias grid-column-gutter
@mixin grid-col-gutter(
$gutter: auto,
$gutters: $grid-column-gutter
) {
@include grid-column-gutter($gutter, $gutters);
}
/// Shorthand for `grid-column-collapse()`.
/// @alias grid-column-collapse
@mixin grid-col-collapse {
@include grid-column-collapse;
}
/// Sets bottom margin on grid columns to match gutters
/// @param {Number|Keyword} $margin [auto]
/// The bottom margin on grid columns, accepts multiple values:
/// - A single value will make the margin that exact size.
/// - A breakpoint name will make the margin the corresponding size in the $margins map.
/// - "auto" will make the margin responsive, using the $margins map values.
/// @param {Number|Map} $margins [$grid-column-gutter] - Map or single value to use. Responsive gutter settings by default.
@mixin grid-column-margin (
$margin: auto,
$margins: $grid-column-gutter
) {
@include -zf-breakpoint-value($margin, $margins) {
$margin-bottom: rem-calc($-zf-bp-value);
margin-bottom: $margin-bottom;
> :last-child {
margin-bottom: 0;
}
}
}
+76
View File
@@ -0,0 +1,76 @@
// Foundation for Sites by ZURB
// foundation.zurb.com
// Licensed under MIT Open Source
////
/// @group grid
////
/// Sizes child elements so that `$n` number of items appear on each row.
///
/// @param {Number} $n - Number of elements to display per row.
/// @param {String} $selector ['.column'] - Selector(s) to use for child elements.
/// @param {Number|List} $gutter
/// The gutter to apply to child elements. Accepts multiple values:
/// - $grid-column-gutter will use the values in the $grid-column-gutter map, including breakpoint sizes.
/// - A fixed numeric value will apply this gutter to all breakpoints.
@mixin grid-layout(
$n,
$selector: '.column',
$gutter: null
) {
& > #{$selector} {
float: $global-left;
width: percentage(1/$n);
// If a $gutter value is passed
@if($gutter) {
// Gutters
@if type-of($gutter) == 'map' {
@each $breakpoint, $value in $gutter {
$padding: rem-calc($value) / 2;
@include breakpoint($breakpoint) {
padding-right: $padding;
padding-left: $padding;
}
}
}
@else if type-of($gutter) == 'number' and strip-unit($gutter) > 0 {
$padding: rem-calc($gutter) / 2;
padding-right: $padding;
padding-left: $padding;
}
}
&:nth-of-type(1n) {
clear: none;
}
&:nth-of-type(#{$n}n+1) {
clear: both;
}
&:last-child {
float: $global-left;
}
}
}
/// Adds extra CSS to block grid children so the last items in the row center automatically. Apply this to the columns, not the row.
///
/// @param {Number} $n - Number of items that appear in each row.
@mixin grid-layout-center-last($n) {
@for $i from 1 to $n {
@if $i == 1 {
&:nth-child(#{$n}n+1):last-child {
margin-left: (100 - 100/$n * $i) / 2 * 1%;
}
}
@else {
&:nth-child(#{$n}n+1):nth-last-child(#{$i}) {
margin-left: (100 - 100/$n * $i) / 2 * 1%;
}
}
}
}
+100
View File
@@ -0,0 +1,100 @@
// Foundation for Sites by ZURB
// foundation.zurb.com
// Licensed under MIT Open Source
////
/// @group grid
////
/// Reposition a column.
///
/// @param {Number|Keyword} $position - It can be:
/// * A number: The column will move equal to the width of the column count
/// specified. A positive number will push the column to the right, while
/// a negative number will pull it to the left.
/// * `center`: Column will be centered
/// * `auto`: Column will be pushed to the left (or to the right for the last column).
@mixin grid-column-position($position) {
// Auto positioning
@if $position == auto {
&, &:last-child:not(:first-child) {
float: $global-left;
clear: none;
}
// Last column alignment
@if $grid-column-align-edge {
&:last-child:not(:first-child) {
float: $global-right;
}
}
}
// Push/pull
@else if type-of($position) == 'number' {
$offset: percentage($position / $grid-column-count);
position: relative;
#{$global-left}: $offset;
}
// Center positioning
@else if $position == center {
&, &:last-child:not(:first-child) {
float: none;
clear: both;
}
margin-right: auto;
margin-left: auto;
}
@else {
@warn 'Wrong syntax for grid-column-position(). Enter a positive or negative number, "center" or "auto".';
}
}
/// Reset a position definition.
@mixin grid-column-unposition {
@include grid-column-position(auto);
position: static;
margin-right: 0;
margin-left: 0;
}
/// Offsets a column to the right by `$n` columns.
/// @param {Number|List} $n - Width to offset by. You can pass in any value accepted by the `grid-column()` mixin, such as `6`, `50%`, or `1 of 2`.
@mixin grid-column-offset($n) {
margin-#{$global-left}: grid-column($n);
}
/// Disable the default behavior of the last column in a row aligning to the opposite edge.
@mixin grid-column-end {
// This extra specificity is required for the property to be applied
&:last-child:last-child {
float: $global-left;
}
}
/// Shorthand for `grid-column-position()`.
/// @alias grid-column-position
@mixin grid-col-pos($position) {
@include grid-column-position($position);
}
/// Shorthand for `grid-column-unposition()`.
/// @alias grid-column-unposition
@mixin grid-col-unpos {
@include grid-column-unposition;
}
/// Shorthand for `grid-column-offset()`.
/// @alias grid-column-offset
@mixin grid-col-off($n) {
@include grid-column-offset($n);
}
/// Shorthand for `grid-column-end()`.
/// @alias grid-column-end
@mixin grid-col-end {
@include grid-column-end;
}
+99
View File
@@ -0,0 +1,99 @@
// Foundation for Sites by ZURB
// foundation.zurb.com
// Licensed under MIT Open Source
////
/// @group grid
////
/// Change the behavior of columns defined inside this mixin to use a different column count.
/// @content
///
/// @param {Number} $columns - Number of columns to use.
/// @param {Boolean} $root [false]
/// If `false`, selectors inside this mixin will nest inside the parent selector.
/// If `true`, selectors will not nest.
@mixin grid-context(
$columns,
$root: false
) {
// Store the current column count so it can be re-set later
$old-grid-column-count: $grid-column-count;
$grid-column-count: $columns !global;
@if $root {
@at-root { @content; }
}
@else {
@content;
}
// Restore the old column count
$grid-column-count: $old-grid-column-count !global;
}
/// Creates a grid row.
/// @content
///
/// @param {Number} $columns [null] - Column count for this row. `null` will use the default column count.
/// @param {Keywords} $behavior [null]
/// Modifications to the default grid styles. `nest` indicates the row will be placed inside another row. `collapse` indicates that the columns inside this row will not have padding. `nest collapse` combines both behaviors.
/// @param {Keyword|Number} $size [$grid-row-width] Maximum size of the row. Set to `expand` to make the row taking the full width.
/// @param {Boolean} $cf [true] - Whether or not to include a clearfix.
/// @param {Number|Map} $gutters [$grid-column-gutter] - Gutter map or single value to use when inverting margins. Responsive gutter settings by default.
@mixin grid-row(
$columns: null,
$behavior: null,
$size: $grid-row-width,
$cf: true,
$gutters: $grid-column-gutter
) {
$margin: auto;
@if index($behavior, nest) != null {
@include grid-row-nest($gutters);
@if index($behavior, collapse) != null {
margin-right: 0;
margin-left: 0;
}
}
@else {
@include grid-row-size($size);
margin-right: auto;
margin-left: auto;
}
@if $cf {
@include clearfix;
}
@if $columns != null {
@include grid-context($columns) {
@content;
}
}
}
/// Inverts the margins of a row to nest it inside of a column.
///
/// @param {Number|Map} $gutters [$grid-column-gutter] - Gutter map or single value to use when inverting margins. Responsive gutter settings by default.
@mixin grid-row-nest($gutters: $grid-column-gutter) {
@include -zf-each-breakpoint {
$margin: rem-calc(-zf-get-bp-val($gutters, $-zf-size)) / 2 * -1;
margin-right: $margin;
margin-left: $margin;
}
}
/// Set a grid row size
///
/// @param {Keyword|Number} $size [$grid-row-width] Maximum size of the row. Set to `expand` to make the row taking the full width.
@mixin grid-row-size($size: $grid-row-width) {
@if $size == expand {
$size: none;
}
max-width: $size;
}
+24
View File
@@ -0,0 +1,24 @@
// Foundation for Sites by ZURB
// foundation.zurb.com
// Licensed under MIT Open Source
////
/// @group grid
////
/// Set the width of a grid column.
///
/// @param {Number|List} $width [$grid-column-count] - Width to make the column. You can pass in any value accepted by the `grid-column()` function, such as `6`, `50%`, or `1 of 2`.
@mixin grid-column-size(
$columns: $grid-column-count
) {
width: grid-column($columns);
}
/// Shorthand for `grid-column-size()`.
/// @alias grid-column-size
@mixin grid-col-size(
$columns: $grid-column-count
) {
@include grid-column-size($columns);
}