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

Commit

Permalink
Re-apply grid styles
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixHenninger committed Aug 18, 2020
1 parent b44fe33 commit 1895ff0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import React, { Fragment } from 'react'

import { FastField, useFormikContext } from 'formik'
import classnames from 'classnames'

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

import './style.css'

const Row = ({ index: rowIndex, name, data, arrayHelpers }) =>
<DefaultRow
index={ rowIndex } arrayHelpers={ arrayHelpers }
Expand Down Expand Up @@ -32,6 +35,11 @@ export default () => {
columns={ columns }
header={ Header }
defaultItem={ Array(columns).fill('') }
className="border-top-0"
className={ classnames({
'table': true,
'grid': true,
'grid-slim': columns > 5,
'border-top-0 border-bottom': true,
}) }
/>
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* Reduce padding in a grid dropdown-toggle button */
table.grid th .input-group button.dropdown-toggle {
padding: 0.5rem 0.8rem;
}

/* Reduce size of input group dropdown toggle,
and hide icon, if columns are very narrow. */
table.grid.grid-slim th .input-group button.dropdown-toggle {
padding: 0.5rem;
}

table.grid.grid-slim th .input-group button.dropdown-toggle i {
display: none;
}

table.grid.grid-slim th .input-group button.dropdown-toggle::after {
margin-left: 0;
}

/* Highlight active dropdown item */
.dropdown-menu .dropdown-item.dropdown-item-active {
background-color: var(--light);
}

0 comments on commit 1895ff0

Please sign in to comment.