123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279 |
- // Copyright 2017-2020 @polkadot/react-components authors & contributors
- // This software may be modified and distributed under the terms
- // of the Apache-2.0 license. See the LICENSE file for details.
- import { createGlobalStyle } from 'styled-components';
- import cssComponents from './components';
- import cssForm from './form';
- import cssMedia from './media';
- import cssRx from './rx';
- import cssSemantic from './semantic';
- import cssTheme from './theme';
- interface Props {
- uiHighlight?: string;
- }
- const defaultHighlight = '#f19135'; // #999
- const getHighlight = (props: Props): string =>
- (props.uiHighlight || defaultHighlight);
- export default createGlobalStyle<Props>`
- .ui--highlight--all {
- background: ${getHighlight} !important;
- border-color: ${getHighlight} !important;
- color: ${getHighlight} !important;
- }
- .ui--highlight--before:before {
- background: ${getHighlight} !important;
- }
- .ui--highlight--bg {
- background: ${getHighlight} !important;
- }
- .ui--highlight--border {
- border-color: ${getHighlight} !important;
- }
- .ui--highlight--color {
- color: ${getHighlight} !important;
- }
- .ui--highlight--fill {
- fill: ${getHighlight} !important;
- }
- .ui--highlight--gradient {
- background: ${(props: Props) => `linear-gradient(90deg, ${props.uiHighlight || defaultHighlight}, transparent)`};
- }
- .ui--highlight--icon {
- .ui--Icon {
- color: ${getHighlight} !important;
- }
- }
- .ui--highlight--stroke {
- stroke: ${getHighlight} !important;
- }
- .ui--Button {
- &:not(.isDisabled):not(.isIcon):not(.isBasic) {
- .ui--Icon {
- background: ${getHighlight};
- color: #f5f5f4;
- }
- }
- &.isBasic:not(.isDisabled):not(.isIcon) {
- &:not(.isReadOnly) {
- box-shadow: 0 0 1px ${getHighlight};
- }
- .ui--Icon {
- color: ${getHighlight};
- }
- }
- &:hover:not(.isDisabled):not(.isReadOnly) {
- background: ${getHighlight};
- color: #f5f5f4;
- text-shadow: none;
- &:not(.isIcon) {
- .ui--Icon {
- color: inherit;
- }
- }
- }
- }
- .ui--Table td .ui--Button {
- &:not(.isDisabled):not(.isIcon) {
- .ui--Icon {
- background: transparent;
- color: ${getHighlight};
- }
- }
- }
- .theme--default {
- .ui--Tabs-Tab.tabLinkActive {
- border-bottom-color: ${getHighlight};
- }
- .ui.negative.button,
- .ui.buttons .negative.button {
- background: #666 !important;
- }
- .ui.primary.button,
- .ui.buttons .primary.button {
- background: ${getHighlight};
- &.active,
- &:active,
- &:focus,
- &:hover {
- background-color: ${getHighlight};
- }
- }
- .ui--Toggle.isChecked .ui--Toggle-Slider {
- background-color: ${getHighlight} !important;
- &:before {
- border-color: ${getHighlight} !important;
- }
- }
- }
- #root {
- color: #4e4e4e;
- font-family: sans-serif;
- height: 100%;
- }
- a {
- cursor: pointer;
- }
- article {
- background: white;
- border: 1px solid #f2f2f2;
- border-radius: 0.25rem;
- box-sizing: border-box;
- margin: 0.25rem;
- padding: 1.25rem;
- position: relative;
- text-align: left;
- > ul {
- margin: 0;
- padding: 0;
- }
- &.error,
- &.warning {
- font-size: 0.95rem;
- margin-left: 2.25rem;
- padding: 0.75rem 1rem;
- }
- &.nomargin {
- margin-left: 0;
- }
- &.error {
- background: #fff6f6;
- border-color: #e0b4b4;
- color: #9f3a38;
- }
- &.padded {
- padding: 0.75rem 1rem;
- > div {
- margin: 0.25rem;
- }
- }
- &.warning {
- background: #ffffe0;
- border-color: #eeeeae;
- }
- }
- body {
- height: 100%;
- margin: 0;
- }
- br {
- line-height: 1.5rem;
- }
- details {
- cursor: pointer;
- &[open] > summary {
- white-space: normal;
- br, br + * {
- display: block;
- }
- }
- > summary {
- text-overflow: ellipsis;
- overflow: hidden;
- white-space: nowrap;
- outline: none;
- br, br + * {
- display: none;
- }
- }
- }
- h1, h2, h3, h4, h5 {
- color: rgba(0, 0, 0, .6);
- font-family: sans-serif;
- font-weight: 100;
- }
- h1 {
- text-transform: lowercase;
- em {
- font-style: normal;
- text-transform: none;
- }
- }
- h1, h2, h3, h4, h5 {
- margin-bottom: 0.25rem;
- }
- header {
- margin-bottom: 1.5rem;
- text-align: center;
- > article {
- background: transparent;
- }
- }
- html {
- height: 100%;
- }
- label {
- box-sizing: border-box;
- color: rgba(78, 78, 78, .66);
- display: block;
- font-family: sans-serif;
- font-size: 1rem;
- font-weight: 100;
- }
- main {
- min-height: 100vh;
- > section {
- margin-bottom: 2em;
- }
- }
- /* Add our overrides */
- ${cssSemantic}
- ${cssTheme}
- ${cssForm}
- ${cssMedia}
- ${cssRx}
- ${cssComponents}
- `;
|