aboutsummaryrefslogtreecommitdiff
path: root/src/components/menu_item.style.js
blob: 6475395aabf2903ebc6645b1521eba003dba4581 (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
export default {
  name: 'MenuItem',
  selector: '.menu-item',
  validInnerComponents: [
    'Text',
    'Icon',
    'Input',
    'Border',
    'ButtonUnstyled'
  ],
  states: {
    hover: ':hover',
    active: '.active'
  },
  defaultRules: [
    {
      directives: {
        background: '--bg',
        opacity: 0
      }
    },
    {
      state: ['hover'],
      directives: {
        background: '$mod(--bg, 5)',
        opacity: 1
      }
    },
    {
      state: ['active'],
      directives: {
        background: '$mod(--bg, 5)',
        opacity: 1
      }
    },
    {
      component: 'Text',
      variant: 'normal',
      parent: {
        component: 'MenuItem',
        state: ['normal', 'hover'],
        variant: 'normal'
      },
      directives: {
        textColor: '--link',
        textAuto: 'no-preserve'
      }
    },
    {
      component: 'Icon',
      parent: {
        component: 'MenuItem',
        state: ['hover']
      },
      directives: {
        textColor: '--link',
        textAuto: 'no-preserve'
      }
    }
  ]
}