Skip to content
This repository was archived by the owner on Nov 22, 2022. It is now read-only.

Commit 1895ff0

Browse files
Re-apply grid styles
1 parent b44fe33 commit 1895ff0

File tree

2 files changed

+32
-1
lines changed
  • packages/builder/src/components/ComponentOptions/components/Content/Loop/Grid

2 files changed

+32
-1
lines changed

packages/builder/src/components/ComponentOptions/components/Content/Loop/Grid/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import React, { Fragment } from 'react'
22

33
import { FastField, useFormikContext } from 'formik'
4+
import classnames from 'classnames'
45

56
import Header from './header'
67
import { Table, DefaultRow } from '../../../../../Form/table'
78

9+
import './style.css'
10+
811
const Row = ({ index: rowIndex, name, data, arrayHelpers }) =>
912
<DefaultRow
1013
index={ rowIndex } arrayHelpers={ arrayHelpers }
@@ -32,6 +35,11 @@ export default () => {
3235
columns={ columns }
3336
header={ Header }
3437
defaultItem={ Array(columns).fill('') }
35-
className="border-top-0"
38+
className={ classnames({
39+
'table': true,
40+
'grid': true,
41+
'grid-slim': columns > 5,
42+
'border-top-0 border-bottom': true,
43+
}) }
3644
/>
3745
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/* Reduce padding in a grid dropdown-toggle button */
2+
table.grid th .input-group button.dropdown-toggle {
3+
padding: 0.5rem 0.8rem;
4+
}
5+
6+
/* Reduce size of input group dropdown toggle,
7+
and hide icon, if columns are very narrow. */
8+
table.grid.grid-slim th .input-group button.dropdown-toggle {
9+
padding: 0.5rem;
10+
}
11+
12+
table.grid.grid-slim th .input-group button.dropdown-toggle i {
13+
display: none;
14+
}
15+
16+
table.grid.grid-slim th .input-group button.dropdown-toggle::after {
17+
margin-left: 0;
18+
}
19+
20+
/* Highlight active dropdown item */
21+
.dropdown-menu .dropdown-item.dropdown-item-active {
22+
background-color: var(--light);
23+
}

0 commit comments

Comments
 (0)