You are here

gridstack.native.css in GridStack 8.2

This file is implementing native browser CSS Grid Layout.

Not needed by original js-driven GridStack, nor static Bootstrap/Foundation. This is a counterpart of gridstack.library.css. This file is NOT loaded at admin UI pages, just front-end.

At most cases, no need to re-touch this file.

See also

https://developer.mozilla.org/en-US/docs/Web/CSS/grid

css/gridstack.css for details

File

css/gridstack.native.css
View source
  1. /**
  2. * @file
  3. * This file is implementing native browser CSS Grid Layout.
  4. *
  5. * Not needed by original js-driven GridStack, nor static Bootstrap/Foundation.
  6. * This is a counterpart of gridstack.library.css.
  7. * @see https://developer.mozilla.org/en-US/docs/Web/CSS/grid
  8. * This file is NOT loaded at admin UI pages, just front-end.
  9. *
  10. * At most cases, no need to re-touch this file.
  11. *
  12. * @see css/gridstack.css for details
  13. */
  14. .gridstack--native {
  15. /* Unfortunately attr() support is still sparse, not even Chrome 2020.
  16. * This part is dynamically overriden by gridstack.native.min.js to make it
  17. * responsive based on config. */
  18. grid-auto-rows: 80px;
  19. /* grid-auto-rows: attr(data-cell-height px, "80px"); */
  20. gap: 10px; /* csslint allow: known-properties, gap */
  21. /* gap: attr(data-vertical-margin px, "10px"); csslint allow: known-properties, gap */
  22. /* Masonry grid-template-columns: repeat(auto-fill, minmax(30%, 1fr)); */
  23. /*
  24. grid-template-columns: repeat(4, 80px);
  25. -ms-grid-columns: 1fr 1fr 1fr 1fr;
  26. grid-template-columns: repeat(4, 1fr);
  27. grid-template-rows: repeat(3, 100px);
  28. grid-template-columns: repeat(12, 1fr);
  29. */
  30. grid-template-columns: auto;
  31. align-content: start; /* csslint allow: known-properties, start */
  32. justify-content: center;
  33. }
  34. .gridstack--native.is-gs-enabled {
  35. display: grid;
  36. }
  37. /** Without margin. */
  38. .gridstack--native.is-gs-nomargin {
  39. gap: 0; /* csslint allow: known-properties, gap */
  40. }
  41. .gridstack--native > .box {
  42. display: flex;
  43. align-items: center;
  44. justify-content: center;
  45. /* @todo must disable
  46. overflow: visible; */
  47. }
  48. /* The original .box js-driven layout is absolute like Masonry, etc.*/
  49. .gridstack--native > .box,
  50. /**
  51. * Absolute is bad for Isotope. Good for static.
  52. * Relative bad for embedded Slick.
  53. * @todo re-check for the best deal.
  54. */
  55. .gridstack--native .box__content {
  56. position: relative;
  57. }
  58. /* The rules are defined at gridstack/ratio, dups in case forgotten/ overriden. */
  59. .gridstack--native.is-gs-enabled .box__content {
  60. height: 100%; /* Should be 0 with padding hack, but it doesn't work that way. */
  61. /*
  62. * @todo check for various contents, including empty, if ok using relative.
  63. * Make it absolute again if any issue. Relative is possible when its inner
  64. * contents have defined heights as solved by JS for few contents. Not all.
  65. */
  66. /* position: absolute; */
  67. width: 100%; /* Normaly auto for JS layout. */
  68. }
  69. /** grid-row == height */
  70. .gridstack--native > .box[data-gs-height='1'] {
  71. -ms-grid-row-span: 1;
  72. grid-row: span 1;
  73. }
  74. .gridstack--native > .box[data-gs-height='2'] {
  75. -ms-grid-row-span: 2;
  76. grid-row: span 2;
  77. }
  78. .gridstack--native > .box[data-gs-height='3'] {
  79. -ms-grid-row-span: 3;
  80. grid-row: span 3;
  81. }
  82. .gridstack--native > .box[data-gs-height='4'] {
  83. -ms-grid-row-span: 4;
  84. grid-row: span 4;
  85. }
  86. .gridstack--native > .box[data-gs-height='5'] {
  87. -ms-grid-row-span: 5;
  88. grid-row: span 5;
  89. }
  90. .gridstack--native > .box[data-gs-height='6'] {
  91. -ms-grid-row-span: 6;
  92. grid-row: span 6;
  93. }
  94. .gridstack--native > .box[data-gs-height='7'] {
  95. -ms-grid-row-span: 7;
  96. grid-row: span 7;
  97. }
  98. .gridstack--native > .box[data-gs-height='8'] {
  99. -ms-grid-row-span: 8;
  100. grid-row: span 8;
  101. }
  102. .gridstack--native > .box[data-gs-height='9'] {
  103. -ms-grid-row-span: 9;
  104. grid-row: span 9;
  105. }
  106. .gridstack--native > .box[data-gs-height='10'] {
  107. -ms-grid-row-span: 10;
  108. grid-row: span 10;
  109. }
  110. .gridstack--native > .box[data-gs-height='11'] {
  111. -ms-grid-row-span: 11;
  112. grid-row: span 11;
  113. }
  114. .gridstack--native > .box[data-gs-height='12'] {
  115. -ms-grid-row-span: 12;
  116. grid-row: span 12;
  117. }
  118. /** grid-column == width */
  119. .gridstack--native > .box[data-gs-width='1'] {
  120. -ms-grid-column-span: 1;
  121. grid-column: span 1;
  122. }
  123. .gridstack--native > .box[data-gs-width='2'] {
  124. -ms-grid-column-span: 2;
  125. grid-column: span 2;
  126. }
  127. .gridstack--native > .box[data-gs-width='3'] {
  128. -ms-grid-column-span: 3;
  129. grid-column: span 3;
  130. }
  131. .gridstack--native > .box[data-gs-width='4'] {
  132. -ms-grid-column-span: 4;
  133. grid-column: span 4;
  134. }
  135. .gridstack--native > .box[data-gs-width='5'] {
  136. -ms-grid-column-span: 5;
  137. grid-column: span 5;
  138. }
  139. .gridstack--native > .box[data-gs-width='6'] {
  140. -ms-grid-column-span: 6;
  141. grid-column: span 6;
  142. }
  143. .gridstack--native > .box[data-gs-width='7'] {
  144. -ms-grid-column-span: 7;
  145. grid-column: span 7;
  146. }
  147. .gridstack--native > .box[data-gs-width='8'] {
  148. -ms-grid-column-span: 8;
  149. grid-column: span 8;
  150. }
  151. .gridstack--native > .box[data-gs-width='9'] {
  152. -ms-grid-column-span: 9;
  153. grid-column: span 9;
  154. }
  155. .gridstack--native > .box[data-gs-width='10'] {
  156. -ms-grid-column-span: 10;
  157. grid-column: span 10;
  158. }
  159. .gridstack--native > .box[data-gs-width='11'] {
  160. -ms-grid-column-span: 11;
  161. grid-column: span 11;
  162. }
  163. .gridstack--native > .box[data-gs-width='12'] {
  164. -ms-grid-column-span: 12;
  165. grid-column: span 12;
  166. }
  167. /* The disabled grid for mobile. */
  168. .gridstack--native.is-gs-disabled,
  169. .gridstack--native.is-gs-disabled > .box {
  170. display: block;
  171. }
  172. /**
  173. * It appears CSSLint doesn't abide by its own rule. It still complains for
  174. * something it doesn't understand while already being told to ignore it.
  175. * Perhaps it is high time Drupal tests to switch to stylelint?
  176. */
  177. /* csslint ignore:start */
  178. @media screen and (min-width: 1024px) {
  179. /* https://github.com/CSSLint/parser-lib/issues/228 */
  180. .gridstack--native {
  181. grid-template-columns: repeat(12, 1fr); /* csslint allow: known-properties, grid-template-columns */
  182. }
  183. }
  184. /* csslint ignore:end */