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

constants.js 4.6KB

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