aboutsummaryrefslogtreecommitdiff
path: root/src/server/Design/LoggedIn/Table.hs
blob: 2876fa164143b9c888d765627e8890e3fc27bb4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{-# LANGUAGE OverloadedStrings #-}

module Design.LoggedIn.Table
  ( tableDesign
  ) where

import Data.Monoid ((<>))

import Clay
import qualified Clay.Display as D

import Design.Color as C
import Design.Media
import Design.Constants

tableDesign :: Css
tableDesign =

  ".table" ? do
    display D.table
    width (pct 100)
    textAlign (alignSide (sideCenter))
    "border-spacing" -: "10 px"

    ".header" <> ".row" ? display tableRow
    let headerHeight = (px 70)

    ".header" ? do
      fontWeight bold
      backgroundColor C.blue
      color C.white
      fontSize iconFontSize
      lineHeight headerHeight

    ".row" ? do
      fontSize (px 20)
      cursor pointer
      lineHeight rowHeight
      nthChild "odd" & backgroundColor C.lightGrey
      ".edition" & do
        backgroundColor C.paymentFocus
        ".delete" ? visibility visible

    ".cell" ? do
      display tableCell
      ".category" & width (pct 40)
      ".cost" & do
        width (pct 17)
        ".refund" & color C.greenSuccess
      ".user" & width (pct 20)
      ".date" & do
        width (pct 20)
        smallScreen $ do
          ".shortDate" ? display inline
          ".longDate" ? display none
        largeScreen $ do
          ".shortDate" ? display none
          ".longDate" ? display inline
      ".delete" & do
        width (pct 3)
        height rowHeight
        textAlign (alignSide sideCenter)
        backgroundColor C.red
        visibility hidden
        button ? do
          width (pct 100)
          height (pct 100)
          color C.white