@dialpad/dialtone-css
Version:
Dialpad's design system
246 lines (208 loc) • 11.4 kB
text/less
//
// DIALTONE
// UTILITIES: GRID
//
// These are the CSS grid utility classes for Dialpad's design system Dialtone.
// For further documentation of these and other classes,
// visit https://dialtone.dialpad.com/utilities/grid
//
// TABLE OF CONTENTS
// • GRID VARIABLES
// • COLUMNS
// • GAP
// • JUSTIFY ITEMS
// • JUSTIFY SELF
// • LAYOUTS
// - AREAS
// • PLACE CONTENT
// • PLACE ITEMS
// • PLACE SELF
// • ROWS
//
// ============================================================================
// $ COLUMNS
// ----------------------------------------------------------------------------
.d-gc-full { grid-column: 1 ~' / ' -1 ; }
.d-gcs-auto { grid-column-start: auto ; }
.d-gce-auto { grid-column-end: auto ; }
.d-gc-auto { grid-column: auto ; }
.d-gcs-unset { grid-column-start: unset ; }
.d-gce-unset { grid-column-end: unset ; }
.d-gc-unset { grid-column: unset ; }
// ============================================================================
// $ GAP
// ============================================================================
// Defines the size of grid 'gaps' (lines). We generate a gap for
// each defined spacing unit.
// TODO: Deprecated classes, remove on our next migration. https://dialpad.atlassian.net/browse/DLT-1763
// ----------------------------------------------------------------------------
.d-gcg-unset { column-gap: unset ; }
.d-grg-unset { row-gap: unset ; }
.d-gg-unset { gap: unset ; }
// ============================================================================
// $ JUSTIFY ITEMS
// Aligns grid items along the main axis.
// ----------------------------------------------------------------------------
.d-ji-center { justify-items: center ; }
.d-ji-end { justify-items: end ; }
.d-ji-start { justify-items: start ; }
.d-ji-left { justify-items: left ; }
.d-ji-right { justify-items: right ; }
.d-ji-baseline { justify-items: baseline ; }
.d-ji-first-baseline { justify-items: first-baseline ; }
.d-ji-last-baseline { justify-items: last-baseline ; }
.d-ji-stretch { justify-items: stretch ; }
.d-ji-safe { justify-items: safe ; }
.d-ji-unsafe { justify-items: unsafe ; }
.d-ji-normal { justify-items: normal ; }
.d-ji-legacy { justify-items: legacy ; }
.d-ji-auto { justify-items: auto ; }
.d-ji-unset { justify-items: unset ; }
// ============================================================================
// $ JUSTIFY SELF
// Aligns grid item along the main axis.
// ----------------------------------------------------------------------------
.d-js-center { justify-self: center ; }
.d-js-end { justify-self: end ; }
.d-js-start { justify-self: start ; }
.d-js-left { justify-self: left ; }
.d-js-right { justify-self: right ; }
.d-js-baseline { justify-self: baseline ; }
.d-js-first-baseline { justify-self: first-baseline ; }
.d-js-last-baseline { justify-self: last-baseline ; }
.d-js-stretch { justify-self: stretch ; }
.d-js-safe { justify-self: safe ; }
.d-js-unsafe { justify-self: unsafe ; }
.d-js-normal { justify-self: normal ; }
.d-js-legacy { justify-self: legacy ; }
.d-js-auto { justify-self: auto ; }
.d-js-unset { justify-self: unset ; }
// ============================================================================
// $ LAYOUTS
// ----------------------------------------------------------------------------
.d-gl-sidebar {
grid-template-areas: 'sidebar content';
grid-template-columns: [sidebar-start] var(--sidebar-width) [sidebar-end content-start] var(--content-width) [content-end];
}
.d-gl-header {
grid-auto-rows: 1fr;
grid-auto-columns: minmax(min-content, auto);
grid-template-areas: 'header'
'content';
grid-template-rows: [header-start] var(--header-height) [header-end content-start] var(--content-height) [content-end];
}
// $ GRID AREAS
// ----------------------------------------------------------------------------
.d-ga-sidebar { grid-area: sidebar ; }
.d-ga-content { grid-area: content ; }
.d-ga-header { grid-area: header ; }
// ============================================================================
// $ PLACE CONTENT
// Aligns grid items along the block and inline directions at once
// ----------------------------------------------------------------------------
.d-plc-center { place-content: center ; }
.d-plc-center-end { place-content: center end ; }
.d-plc-center-start { place-content: center start ; }
.d-plc-center-stretch { place-content: center stretch ; }
.d-plc-center-space-around { place-content: center space-around ; }
.d-plc-center-space-evenly { place-content: center space-evenly ; }
.d-plc-center-space-between { place-content: center space-between ; }
.d-plc-end { place-content: end ; }
.d-plc-end-start { place-content: end start ; }
.d-plc-end-stretch { place-content: end stretch ; }
.d-plc-end-center { place-content: end center ; }
.d-plc-end-space-around { place-content: end space-around ; }
.d-plc-end-space-evenly { place-content: end space-evenly ; }
.d-plc-end-space-between { place-content: end space-between ; }
.d-plc-start { place-content: start ; }
.d-plc-start-end { place-content: start end ; }
.d-plc-start-center { place-content: start center ; }
.d-plc-start-stretch { place-content: start stretch ; }
.d-plc-start-space-around { place-content: start space-around ; }
.d-plc-start-space-evenly { place-content: start space-evenly ; }
.d-plc-start-space-between { place-content: start space-between ; }
.d-plc-stretch { place-content: stretch ; }
.d-plc-stretch-end { place-content: stretch end ; }
.d-plc-stretch-start { place-content: stretch start ; }
.d-plc-stretch-center { place-content: stretch center ; }
.d-plc-stretch-space-evenly { place-content: stretch space-evenly ; }
.d-plc-stretch-space-around { place-content: stretch space-around ; }
.d-plc-stretch-space-between { place-content: stretch space-between ; }
.d-plc-space-around { place-content: space-around ; }
.d-plc-space-around-end { place-content: space-around end ; }
.d-plc-space-around-start { place-content: space-around start ; }
.d-plc-space-around-center { place-content: space-around center ; }
.d-plc-space-around-space-evenly { place-content: space-around space-evenly ; }
.d-plc-space-around-space-between { place-content: space-around space-between ; }
.d-plc-space-evenly { place-content: space-evenly ; }
.d-plc-space-evenly-end { place-content: space-evenly end ; }
.d-plc-space-evenly-start { place-content: space-evenly start ; }
.d-plc-space-evenly-center { place-content: space-evenly center ; }
.d-plc-space-evenly-space-around { place-content: space-evenly space-around ; }
.d-plc-space-evenly-space-between { place-content: space-evenly space-between ; }
.d-plc-space-between { place-content: space-between ; }
.d-plc-space-between-end { place-content: space-between end ; }
.d-plc-space-between-start { place-content: space-between start ; }
.d-plc-space-between-center { place-content: space-between center ; }
.d-plc-space-between-space-around { place-content: space-between space-around ; }
.d-plc-space-between-space-evenly { place-content: space-between space-evenly ; }
.d-plc-normal { place-content: normal ; }
.d-plc-legacy { place-content: legacy ; }
.d-plc-auto { place-content: auto ; }
.d-plc-unset { place-content: unset ; }
// ============================================================================
// $ PLACE ITEMS
// ----------------------------------------------------------------------------
.d-pli-center { place-items: center ; }
.d-pli-center-end { place-items: center end ; }
.d-pli-center-start { place-items: center start ; }
.d-pli-center-stretch { place-items: center stretch ; }
.d-pli-end { place-items: end ; }
.d-pli-end-start { place-items: end start ; }
.d-pli-end-stretch { place-items: end stretch ; }
.d-pli-end-center { place-items: end center ; }
.d-pli-start { place-items: start ; }
.d-pli-start-end { place-items: start end ; }
.d-pli-start-center { place-items: start center ; }
.d-pli-start-stretch { place-items: start stretch ; }
.d-pli-stretch { place-items: stretch ; }
.d-pli-stretch-end { place-items: stretch end ; }
.d-pli-stretch-start { place-items: stretch start ; }
.d-pli-stretch-center { place-items: stretch center ; }
.d-pli-normal { place-items: normal ; }
.d-pli-legacy { place-items: legacy ; }
.d-pli-auto { place-items: auto ; }
.d-pli-unset { place-items: unset ; }
// ============================================================================
// $ PLACE SELF
// ----------------------------------------------------------------------------
.d-pls-center { place-self: center ; }
.d-pls-center-end { place-self: center end ; }
.d-pls-center-start { place-self: center start ; }
.d-pls-center-stretch { place-self: center stretch ; }
.d-pls-end { place-self: end ; }
.d-pls-end-start { place-self: end start ; }
.d-pls-end-stretch { place-self: end stretch ; }
.d-pls-end-center { place-self: end center ; }
.d-pls-start { place-self: start ; }
.d-pls-start-end { place-self: start end ; }
.d-pls-start-center { place-self: start center ; }
.d-pls-start-stretch { place-self: start stretch ; }
.d-pls-stretch { place-self: stretch ; }
.d-pls-stretch-end { place-self: stretch end ; }
.d-pls-stretch-start { place-self: stretch start ; }
.d-pls-stretch-center { place-self: stretch center ; }
.d-pls-normal { place-self: normal ; }
.d-pls-legacy { place-self: legacy ; }
.d-pls-auto { place-self: auto ; }
.d-pls-unset { place-self: unset ; }
// ============================================================================
// $ ROWS
// ----------------------------------------------------------------------------
.d-gr-full { grid-row: 1 ~' / ' -1 ; }
.d-grs-auto { grid-row-start: auto ; }
.d-gre-auto { grid-row-end: auto ; }
.d-gr-auto { grid-row: auto ; }
.d-grs-unset { grid-row-start: unset ; }
.d-gre-unset { grid-row-end: unset ; }
.d-gr-unset { grid-row: unset ; }