You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

constants.js 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. // @flow
  2. /**
  3. * An object containing all the class names for common CSS.
  4. * Add a new name here and the styles to {@code commonStyles} object.
  5. *
  6. */
  7. export const commonClassName = {
  8. emptyList: 'empty-list',
  9. overflowMenuItem: 'overflow-menu-item',
  10. overflowMenuItemIcon: 'overflow-menu-item-icon',
  11. participantAvatar: 'participant-avatar',
  12. toolboxIcon: 'toolbox-icon',
  13. toolboxButton: 'toolbox-button',
  14. toolboxContentItems: 'toolbox-content-items'
  15. };
  16. /**
  17. * Returns an object containing the declaration of the common, reusable CSS classes.
  18. *
  19. * @param {Object} theme -The theme.
  20. *
  21. * @returns {Object} - The common styles.
  22. */
  23. export const commonStyles = (theme: Object) => {
  24. return {
  25. // '.empty-list'
  26. [commonClassName.emptyList]: {
  27. listStyleType: 'none',
  28. margin: 0,
  29. padding: 0
  30. },
  31. [commonClassName.overflowMenuItem]: {
  32. alignItems: 'center',
  33. color: theme.palette.text01,
  34. cursor: 'pointer',
  35. display: 'flex',
  36. fontSize: 14,
  37. fontWeight: 400,
  38. height: 40,
  39. lineHeight: '24px',
  40. padding: '8px 16px',
  41. boxSizing: 'border-box',
  42. '& > div': {
  43. display: 'flex',
  44. alignItems: 'center'
  45. },
  46. '&.unclickable': {
  47. cursor: 'default'
  48. },
  49. '&.disabled': {
  50. cursor: 'initial',
  51. color: theme.palette.text03,
  52. '&:hover': {
  53. background: 'none'
  54. },
  55. '& svg': {
  56. fill: theme.palette.text03
  57. }
  58. },
  59. '@media (hover: hover) and (pointer: fine)': {
  60. '&:hover': {
  61. background: theme.palette.action02Hover
  62. },
  63. '&.unclickable:hover': {
  64. background: 'inherit'
  65. }
  66. }
  67. },
  68. [commonClassName.overflowMenuItemIcon]: {
  69. marginRight: '16px',
  70. '& i': {
  71. display: 'inline',
  72. fontSize: 24
  73. },
  74. '@media (hover: hover) and (pointer: fine)': {
  75. '&i:hover': {
  76. backgroundColor: 'initial'
  77. }
  78. },
  79. '& img': {
  80. maxWidth: 24,
  81. maxHeight: 24
  82. },
  83. '& svg': {
  84. fill: theme.palette.text01,
  85. height: 20,
  86. width: 20
  87. }
  88. },
  89. [commonClassName.participantAvatar]: {
  90. margin: `${theme.spacing(2)} ${theme.spacing(3)} ${theme.spacing(2)} 0`
  91. },
  92. [commonClassName.toolboxIcon]: {
  93. display: 'flex',
  94. borderRadius: 3,
  95. flexDirection: 'column',
  96. fontSize: 24,
  97. height: 48,
  98. justifyContent: 'center',
  99. width: 48,
  100. '@media (hover: hover) and (pointer: fine)': {
  101. '&:hover': {
  102. background: theme.palette.action02Hover
  103. }
  104. },
  105. [theme.breakpoints.down('320')]: {
  106. height: 36,
  107. width: 36
  108. },
  109. '&.toggled': {
  110. background: theme.palette.ui02
  111. },
  112. '&.disabled': {
  113. cursor: 'initial !important',
  114. backgroundColor: `${theme.palette.action02Disabled} !important`,
  115. '& svg': {
  116. fill: `${theme.palette.text03} !important`
  117. }
  118. }
  119. },
  120. [commonClassName.toolboxButton]: {
  121. color: theme.palette.text01,
  122. cursor: 'pointer',
  123. display: 'inline-block',
  124. lineHeight: '48px',
  125. textAlign: 'center'
  126. },
  127. [commonClassName.toolboxContentItems]: {
  128. background: theme.palette.ui01,
  129. borderRadius: 6,
  130. margin: '0 auto',
  131. padding: 6,
  132. textAlign: 'center',
  133. pointerEvents: 'all',
  134. boxShadow: '0px 2px 8px 4px rgba(0, 0, 0, 0.25), 0px 0px 0px 1px rgba(0, 0, 0, 0.15)',
  135. '& > div': {
  136. marginLeft: 8,
  137. '&:first-child': {
  138. marginLeft: 0
  139. }
  140. }
  141. }
  142. };
  143. };
  144. /**
  145. * Returns the global styles.
  146. *
  147. * @param {Object} theme - The Jitsi theme.
  148. * @returns {Object}
  149. */
  150. export const getGlobalStyles = (theme: Object) => {
  151. return {
  152. // @atlaskit/modal-dialog OVERRIDES
  153. '.atlaskit-portal div[role=dialog]': {
  154. // override dialog background
  155. '& > div': {
  156. background: theme.palette.ui02,
  157. color: theme.palette.text01
  158. }
  159. }
  160. };
  161. };