您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

constants.js 5.4KB

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