diff --git a/.bumpedrc b/.bumpedrc index 04826e51..f283773f 100644 --- a/.bumpedrc +++ b/.bumpedrc @@ -23,7 +23,7 @@ plugins: 'Commiting new version': plugin: 'bumped-terminal' - command: 'git add CHANGELOG.md package.json && git commit package.json -m "Release $newVersion"' + command: 'git add CHANGELOG.md package.json && git commit CHANGELOG.md package.json -m "Release $newVersion"' 'Detecting problem before publish': plugin: 'bumped-terminal' diff --git a/.sass-lint.yml b/.sass-lint.yml deleted file mode 100644 index abd6057e..00000000 --- a/.sass-lint.yml +++ /dev/null @@ -1,397 +0,0 @@ -options: - formatter: stylish - merge-default-rules: false -rules: - border-zero: 1 - brace-style: - - 1 - - allow-single-line: true - class-name-format: - - 0 - - convention: hyphenatedlowercase - clean-import-paths: - - 1 - - filename-extension: false - leading-underscore: false - empty-line-between-blocks: - - 0 - - ignore-single-line-rulesets: true - extends-before-declarations: 0 - extends-before-mixins: 0 - final-newline: - - 1 - - include: true - force-attribute-nesting: 0 - force-element-nesting: 0 - force-pseudo-nesting: 0 - function-name-format: - - 1 - - allow-leading-underscore: true - convention: hyphenatedlowercase - hex-length: - - 1 - - style: short - hex-notation: - - 1 - - style: lowercase - id-name-format: - - 0 - - convention: hyphenatedlowercase - indentation: - - 1 - - size: 2 - leading-zero: - - 0 - - include: false - mixin-name-format: - - 1 - - allow-leading-underscore: true - convention: hyphenatedlowercase - mixins-before-declarations: 0 - nesting-depth: 0 - no-color-literals: 0 - no-css-comments: 1 - no-debug: 1 - no-duplicate-properties: - - 1 - - exclude: [] - no-empty-rulesets: 1 - no-ids: 1 - no-important: 0 - no-invalid-hex: 1 - no-mergeable-selectors: 0 - no-misspelled-properties: - - 1 - - extra-properties: - - composes - no-qualifying-elements: - - 0 - - allow-element-with-attribute: false - allow-element-with-class: false - allow-element-with-id: false - no-trailing-zero: 1 - no-url-protocols: 1 - placeholder-in-extend: 0 - property-sort-order: - - 1 - - ignore-custom-properties: false - order: - - $variable - - $extend - - $include - - composes - - position - - top - - right - - bottom - - left - - z-index - - '-webkit-box-sizing' - - '-moz-box-sizing' - - box-sizing - - display - - float - - width - - min-width - - max-width - - height - - min-height - - max-height - - flex - - flex-align - - flex-direction - - flex-flow - - flex-grow - - flex-order - - flex-pack - - flex-wrap - - align-content - - align-items - - justify-content - - padding - - padding-top - - padding-right - - padding-bottom - - padding-left - - margin - - margin-top - - margin-right - - margin-bottom - - margin-left - - overflow - - overflow-x - - overflow-y - - '-webkit-overflow-scrolling' - - '-ms-overflow-x' - - '-ms-overflow-y' - - '-ms-overflow-style' - - clip - - clear - - font - - font-family - - font-size - - font-style - - font-weight - - font-variant - - font-size-adjust - - font-stretch - - font-effect - - font-emphasize - - font-emphasize-position - - font-emphasize-style - - font-smooth - - '-webkit-hyphens' - - '-moz-hyphens' - - hyphens - - line-height - - color - - text-align - - '-webkit-text-align-last' - - '-moz-text-align-last' - - '-ms-text-align-last' - - text-align-last - - text-emphasis - - text-emphasis-color - - text-emphasis-style - - text-emphasis-position - - text-decoration - - text-indent - - text-justify - - text-outline - - '-ms-text-overflow' - - text-overflow - - text-overflow-ellipsis - - text-overflow-mode - - text-shadow - - text-transform - - text-wrap - - '-webkit-text-size-adjust' - - '-ms-text-size-adjust' - - letter-spacing - - '-ms-word-break' - - word-break - - word-spacing - - '-ms-word-wrap' - - word-wrap - - '-moz-tab-size' - - '-o-tab-size' - - tab-size - - white-space - - vertical-align - - list-style - - list-style-position - - list-style-type - - list-style-image - - pointer-events - - '-ms-touch-action' - - touch-action - - cursor - - visibility - - zoom - - table-layout - - empty-cells - - caption-side - - border-spacing - - border-collapse - - content - - quotes - - counter-reset - - counter-increment - - resize - - '-webkit-user-select' - - '-moz-user-select' - - '-ms-user-select' - - '-o-user-select' - - user-select - - nav-index - - nav-up - - nav-right - - nav-down - - nav-left - - background - - background-color - - background-image - - "-ms-filter:\\'progid:DXImageTransform.Microsoft.gradient" - - 'filter:progid:DXImageTransform.Microsoft.gradient' - - 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader' - - filter - - background-repeat - - background-attachment - - background-position - - background-position-x - - background-position-y - - '-webkit-background-clip' - - '-moz-background-clip' - - background-clip - - background-origin - - '-webkit-background-size' - - '-moz-background-size' - - '-o-background-size' - - background-size - - border - - border-color - - border-style - - border-width - - border-top - - border-top-color - - border-top-style - - border-top-width - - border-right - - border-right-color - - border-right-style - - border-right-width - - border-bottom - - border-bottom-color - - border-bottom-style - - border-bottom-width - - border-left - - border-left-color - - border-left-style - - border-left-width - - border-radius - - border-top-left-radius - - border-top-right-radius - - border-bottom-right-radius - - border-bottom-left-radius - - '-webkit-border-image' - - '-moz-border-image' - - '-o-border-image' - - border-image - - '-webkit-border-image-source' - - '-moz-border-image-source' - - '-o-border-image-source' - - border-image-source - - '-webkit-border-image-slice' - - '-moz-border-image-slice' - - '-o-border-image-slice' - - border-image-slice - - '-webkit-border-image-width' - - '-moz-border-image-width' - - '-o-border-image-width' - - border-image-width - - '-webkit-border-image-outset' - - '-moz-border-image-outset' - - '-o-border-image-outset' - - border-image-outset - - '-webkit-border-image-repeat' - - '-moz-border-image-repeat' - - '-o-border-image-repeat' - - border-image-repeat - - outline - - outline-width - - outline-style - - outline-color - - outline-offset - - '-webkit-box-shadow' - - '-moz-box-shadow' - - box-shadow - - 'filter:progid:DXImageTransform.Microsoft.Alpha(Opacity' - - "-ms-filter:\\'progid:DXImageTransform.Microsoft.Alpha" - - opacity - - '-ms-interpolation-mode' - - '-webkit-transition' - - '-moz-transition' - - '-ms-transition' - - '-o-transition' - - transition - - '-webkit-transition-delay' - - '-moz-transition-delay' - - '-ms-transition-delay' - - '-o-transition-delay' - - transition-delay - - '-webkit-transition-timing-function' - - '-moz-transition-timing-function' - - '-ms-transition-timing-function' - - '-o-transition-timing-function' - - transition-timing-function - - '-webkit-transition-duration' - - '-moz-transition-duration' - - '-ms-transition-duration' - - '-o-transition-duration' - - transition-duration - - '-webkit-transition-property' - - '-moz-transition-property' - - '-ms-transition-property' - - '-o-transition-property' - - transition-property - - transform-style - - '-webkit-transform' - - '-moz-transform' - - '-ms-transform' - - '-o-transform' - - transform - - '-webkit-transform-origin' - - '-moz-transform-origin' - - '-ms-transform-origin' - - '-o-transform-origin' - - transform-origin - - '-webkit-animation' - - '-moz-animation' - - '-ms-animation' - - '-o-animation' - - animation - - '-webkit-animation-name' - - '-moz-animation-name' - - '-ms-animation-name' - - '-o-animation-name' - - animation-name - - '-webkit-animation-duration' - - '-moz-animation-duration' - - '-ms-animation-duration' - - '-o-animation-duration' - - animation-duration - - '-webkit-animation-play-state' - - '-moz-animation-play-state' - - '-ms-animation-play-state' - - '-o-animation-play-state' - - animation-play-state - - '-webkit-animation-timing-function' - - '-moz-animation-timing-function' - - '-ms-animation-timing-function' - - '-o-animation-timing-function' - - animation-timing-function - - '-webkit-animation-delay' - - '-moz-animation-delay' - - '-ms-animation-delay' - - '-o-animation-delay' - - animation-delay - - '-webkit-animation-iteration-count' - - '-moz-animation-iteration-count' - - '-ms-animation-iteration-count' - - '-o-animation-iteration-count' - - animation-iteration-count - - '-webkit-animation-direction' - - '-moz-animation-direction' - - '-ms-animation-direction' - - '-o-animation-direction' - - animation-direction - - backface-visibility - - will-change - - fill - quotes: - - 1 - - style: double - shorthand-values: 1 - single-line-per-selector: 0 - space-after-bang: - - 1 - - include: false - space-after-colon: 1 - space-after-comma: 0 - space-before-bang: - - 1 - - include: true - space-before-brace: - - 1 - - include: true - space-before-colon: 1 - space-between-parens: - - 1 - - include: false - trailing-semicolon: 1 - url-quotes: 1 - variable-name-format: - - 1 - - allow-leading-underscore: true - convention: hyphenatedlowercase - zero-unit: 1 diff --git a/.stylelintrc b/.stylelintrc new file mode 100644 index 00000000..de1aeda1 --- /dev/null +++ b/.stylelintrc @@ -0,0 +1,26 @@ +{ + "extends": "stylelint-config-standard", + "rules": { + "at-rule-no-unknown": [true, { + ignoreAtRules: ["define-mixin", "mixin", "each"] + }], + "property-no-unknown": [ true, { + "ignoreProperties": [ + "composes", + "font-smoothing" + ] + }], + "color-hex-case": "lower", + "declaration-block-properties-order": "alphabetical", + "font-family-name-quotes": "always-where-recommended", + "string-quotes": "single", + "selector-pseudo-class-no-unknown": [ + true, + { + "ignorePseudoClasses": [ + "global" + ] + } + ] + } +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 743b1706..fcf5dfa0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,108 @@ + +# 2.0.0-beta.0 (2016-12-07) + +* Add CHANGELOG to release command ([50b7a95](https://github.com/react-toolbox/react-toolbox/commit/50b7a95)) +* add default prop className to Layout, NavDrawer and Sidebar ([868c284](https://github.com/react-toolbox/react-toolbox/commit/868c284)) +* Add inner layer to AppBar ([8c541e2](https://github.com/react-toolbox/react-toolbox/commit/8c541e2)) +* Add missing Drawer identifier ([5616697](https://github.com/react-toolbox/react-toolbox/commit/5616697)) +* add smTablet and lgTablet to NavDrawer in Layout readme ([3ef9415](https://github.com/react-toolbox/react-toolbox/commit/3ef9415)) +* Adds onQueryChange callback property to Autocomplete ([e971fb4](https://github.com/react-toolbox/react-toolbox/commit/e971fb4)) +* Build using Gulp ([fbae545](https://github.com/react-toolbox/react-toolbox/commit/fbae545)) +* Enabled HMR for styles by disabling extracting them to a CSS file ([52c4829](https://github.com/react-toolbox/react-toolbox/commit/52c4829)) +* Export ThemeProvider from react-css-themr ([6af337c](https://github.com/react-toolbox/react-toolbox/commit/6af337c)) +* Fix #965 ([c92b3c8](https://github.com/react-toolbox/react-toolbox/commit/c92b3c8)), closes [#965](https://github.com/react-toolbox/react-toolbox/issues/965) +* Fix #966 ([9944ef8](https://github.com/react-toolbox/react-toolbox/commit/9944ef8)), closes [#966](https://github.com/react-toolbox/react-toolbox/issues/966) +* fix css linter errors in card and slider ([5ec9d6c](https://github.com/react-toolbox/react-toolbox/commit/5ec9d6c)) +* Fix old sass var in list/config.css ([7d621ed](https://github.com/react-toolbox/react-toolbox/commit/7d621ed)) +* Fixes #1021 ([8c250c6](https://github.com/react-toolbox/react-toolbox/commit/8c250c6)), closes [#1021](https://github.com/react-toolbox/react-toolbox/issues/1021) +* Fixes #1025 ([c18ffa4](https://github.com/react-toolbox/react-toolbox/commit/c18ffa4)), closes [#1025](https://github.com/react-toolbox/react-toolbox/issues/1025) +* Fixes #976 ([0e89b2d](https://github.com/react-toolbox/react-toolbox/commit/0e89b2d)), closes [#976](https://github.com/react-toolbox/react-toolbox/issues/976) +* fixes old sass var in css config ([da0c470](https://github.com/react-toolbox/react-toolbox/commit/da0c470)) +* Input ready to accept visible hint ([577feb3](https://github.com/react-toolbox/react-toolbox/commit/577feb3)) +* Latest build ([f032f68](https://github.com/react-toolbox/react-toolbox/commit/f032f68)) +* Latest build ([170ee4d](https://github.com/react-toolbox/react-toolbox/commit/170ee4d)) +* New layout ([fd79c84](https://github.com/react-toolbox/react-toolbox/commit/fd79c84)) +* New Table implementation ([7d0035a](https://github.com/react-toolbox/react-toolbox/commit/7d0035a)) +* Prepare slider and progress to be disabled ([69f7868](https://github.com/react-toolbox/react-toolbox/commit/69f7868)) +* Refactor Dialog, Drawer and Overlay to be used in Layout ([8e76427](https://github.com/react-toolbox/react-toolbox/commit/8e76427)) +* remove layout playground example ([76c636d](https://github.com/react-toolbox/react-toolbox/commit/76c636d)) +* Remove lib ([6874dbb](https://github.com/react-toolbox/react-toolbox/commit/6874dbb)) +* Remove lib from repo ([d7f743a](https://github.com/react-toolbox/react-toolbox/commit/d7f743a)) +* Remove normalize.css from commons.css ([1b62b78](https://github.com/react-toolbox/react-toolbox/commit/1b62b78)) +* Remove sass lint ([532abd1](https://github.com/react-toolbox/react-toolbox/commit/532abd1)) +* Render Snackbar using Portal ([b293fa1](https://github.com/react-toolbox/react-toolbox/commit/b293fa1)) +* Typings for Table component ([6540226](https://github.com/react-toolbox/react-toolbox/commit/6540226)) +* Update dependencies ([67cec5b](https://github.com/react-toolbox/react-toolbox/commit/67cec5b)) +* Update lib build ([c4f968b](https://github.com/react-toolbox/react-toolbox/commit/c4f968b)) +* Update linter ([23e538f](https://github.com/react-toolbox/react-toolbox/commit/23e538f)) +* Updated css-related dependencies ([292b838](https://github.com/react-toolbox/react-toolbox/commit/292b838)) +* Use Layout in spec ([042ecba](https://github.com/react-toolbox/react-toolbox/commit/042ecba)) + + + + +# 2.0.0-beta.0 (2016-10-06) + +* Add base CSS variables ([05302dd](https://github.com/react-toolbox/react-toolbox/commit/05302dd)) +* Add CSS colors ([624b875](https://github.com/react-toolbox/react-toolbox/commit/624b875)) +* Add CSS custom media queries ([c81dee4](https://github.com/react-toolbox/react-toolbox/commit/c81dee4)) +* Add missing input config variables for Dropdown and Autocomplete ([159da10](https://github.com/react-toolbox/react-toolbox/commit/159da10)) +* Add postcss-mixins and postcss-each ([1f55336](https://github.com/react-toolbox/react-toolbox/commit/1f55336)) +* Add postcss-next postcss-include and reporter ([fa35b84](https://github.com/react-toolbox/react-toolbox/commit/fa35b84)) +* Add shadows to CSS variables ([ac60b21](https://github.com/react-toolbox/react-toolbox/commit/ac60b21)) +* Add some missing nesting notations ([6b2e71d](https://github.com/react-toolbox/react-toolbox/commit/6b2e71d)) +* Add stylelint ([990d159](https://github.com/react-toolbox/react-toolbox/commit/990d159)) +* Bugfix in avatar css ([6c87982](https://github.com/react-toolbox/react-toolbox/commit/6c87982)) +* Build with CSS ([7ddf7e3](https://github.com/react-toolbox/react-toolbox/commit/7ddf7e3)) +* Bye from docs to sass ([9e7121b](https://github.com/react-toolbox/react-toolbox/commit/9e7121b)) +* Fix bug in button theme ([2e16602](https://github.com/react-toolbox/react-toolbox/commit/2e16602)) +* Fix linter errors ([ca19130](https://github.com/react-toolbox/react-toolbox/commit/ca19130)) +* Fix tests ([ac922f6](https://github.com/react-toolbox/react-toolbox/commit/ac922f6)) +* Fix tests ([6dcd36b](https://github.com/react-toolbox/react-toolbox/commit/6dcd36b)) +* Fixed typo in list/config.css ([7aae2fb](https://github.com/react-toolbox/react-toolbox/commit/7aae2fb)) +* Latest build ([9b263ff](https://github.com/react-toolbox/react-toolbox/commit/9b263ff)) +* Migrate animations to PostCSS ([2547c5c](https://github.com/react-toolbox/react-toolbox/commit/2547c5c)) +* Migrate AppBar style to PostCSS ([a5ad4fc](https://github.com/react-toolbox/react-toolbox/commit/a5ad4fc)) +* Migrate Autocomplete style to PostCSS ([6c615d6](https://github.com/react-toolbox/react-toolbox/commit/6c615d6)) +* Migrate Avatar style to PostCSS ([30cf0c8](https://github.com/react-toolbox/react-toolbox/commit/30cf0c8)) +* Migrate Button style to PostCSS ([b7bd84d](https://github.com/react-toolbox/react-toolbox/commit/b7bd84d)) +* Migrate Card style to PostCSS ([e9c2824](https://github.com/react-toolbox/react-toolbox/commit/e9c2824)) +* Migrate Checkbox style to PostCSS ([5f0a25c](https://github.com/react-toolbox/react-toolbox/commit/5f0a25c)) +* Migrate Chip style to PostCSS ([d3520d7](https://github.com/react-toolbox/react-toolbox/commit/d3520d7)) +* Migrate commons to PostCSS ([c02f204](https://github.com/react-toolbox/react-toolbox/commit/c02f204)) +* Migrate DataPicker style to PostCSS ([334620c](https://github.com/react-toolbox/react-toolbox/commit/334620c)) +* Migrate Dialog style to PostCSS ([c85ea04](https://github.com/react-toolbox/react-toolbox/commit/c85ea04)) +* Migrate Drawer style to PostCSS ([ae11fae](https://github.com/react-toolbox/react-toolbox/commit/ae11fae)) +* Migrate Dropdown style to PostCSS ([d6d4dff](https://github.com/react-toolbox/react-toolbox/commit/d6d4dff)) +* Migrate Input style to PostCSS ([090b098](https://github.com/react-toolbox/react-toolbox/commit/090b098)) +* Migrate Layout style to PostCSS ([247e973](https://github.com/react-toolbox/react-toolbox/commit/247e973)) +* Migrate Link style to PostCSS ([95cf291](https://github.com/react-toolbox/react-toolbox/commit/95cf291)) +* Migrate List style to PostCSS ([f8f1edd](https://github.com/react-toolbox/react-toolbox/commit/f8f1edd)) +* Migrate Menu style to PostCSS ([955ca1d](https://github.com/react-toolbox/react-toolbox/commit/955ca1d)) +* Migrate Navigation style to PostCSS ([7524ff0](https://github.com/react-toolbox/react-toolbox/commit/7524ff0)) +* Migrate Overlay style to PostCSS ([9aa9547](https://github.com/react-toolbox/react-toolbox/commit/9aa9547)) +* Migrate ProgressBar style to PostCSS ([47c2621](https://github.com/react-toolbox/react-toolbox/commit/47c2621)) +* Migrate Radio style to PostCSS ([f6bd59b](https://github.com/react-toolbox/react-toolbox/commit/f6bd59b)) +* Migrate Ripple style to PostCSS ([e4bebc8](https://github.com/react-toolbox/react-toolbox/commit/e4bebc8)) +* Migrate Slider style to PostCSS ([59c5ada](https://github.com/react-toolbox/react-toolbox/commit/59c5ada)) +* Migrate Snackbar style to PostCSS ([44849be](https://github.com/react-toolbox/react-toolbox/commit/44849be)) +* Migrate Switch style to PostCSS ([6cc0dc7](https://github.com/react-toolbox/react-toolbox/commit/6cc0dc7)) +* Migrate Table style to PostCSS ([c6b19b6](https://github.com/react-toolbox/react-toolbox/commit/c6b19b6)) +* Migrate Tabs style to PostCSS ([ae0b0fb](https://github.com/react-toolbox/react-toolbox/commit/ae0b0fb)) +* Migrate TimePicker to PostCSS ([153ab93](https://github.com/react-toolbox/react-toolbox/commit/153ab93)) +* Migrate Tooltip styles to PostCSS ([ab74c58](https://github.com/react-toolbox/react-toolbox/commit/ab74c58)) +* Release 2.0.0-beta.0 ([280bf69](https://github.com/react-toolbox/react-toolbox/commit/280bf69)) +* Remove AppBar SASS dependency from spec page ([1011eb3](https://github.com/react-toolbox/react-toolbox/commit/1011eb3)) +* Remove sass from main project ([7b562b8](https://github.com/react-toolbox/react-toolbox/commit/7b562b8)) +* Remove unneded deps for sass in docs subproject ([72fdc19](https://github.com/react-toolbox/react-toolbox/commit/72fdc19)) +* Remove unneeded media CSS import in Avatar ([359d6be](https://github.com/react-toolbox/react-toolbox/commit/359d6be)) +* Update webpack config for testing and tests ([5da2583](https://github.com/react-toolbox/react-toolbox/commit/5da2583)) +* Update webpack test config and linting from npm ([2a735cd](https://github.com/react-toolbox/react-toolbox/commit/2a735cd)) +* use 4p shadow in AppBar as spec indicates ([1da85d3](https://github.com/react-toolbox/react-toolbox/commit/1da85d3)) +* Use dashes for CSS colors ([566b349](https://github.com/react-toolbox/react-toolbox/commit/566b349)) + + + ## 1.1.2 (2016-08-11) diff --git a/components/ThemeProvider.js b/components/ThemeProvider.js new file mode 100644 index 00000000..2620cb55 --- /dev/null +++ b/components/ThemeProvider.js @@ -0,0 +1 @@ +export { ThemeProvider as default } from 'react-css-themr'; diff --git a/components/_colors.scss b/components/_colors.scss deleted file mode 100644 index c2eb5099..00000000 --- a/components/_colors.scss +++ /dev/null @@ -1,301 +0,0 @@ -//-- Color definitions taken from Material Design Lite - -// Red -$palette-red-50: rgb(255,235,238); -$palette-red-100: rgb(255,205,210); -$palette-red-200: rgb(239,154,154); -$palette-red-300: rgb(229,115,115); -$palette-red-400: rgb(239,83,80); -$palette-red-500: rgb(244,67,54); -$palette-red-600: rgb(229,57,53); -$palette-red-700: rgb(211,47,47); -$palette-red-800: rgb(198,40,40); -$palette-red-900: rgb(183,28,28); -$palette-red-a100: rgb(255,138,128); -$palette-red-a200: rgb(255,82,82); -$palette-red-a400: rgb(255,23,68); -$palette-red-a700: rgb(213,0,0); - -// Pink -$palette-pink-50: rgb(252,228,236); -$palette-pink-100: rgb(248,187,208); -$palette-pink-200: rgb(244,143,177); -$palette-pink-300: rgb(240,98,146); -$palette-pink-400: rgb(236,64,122); -$palette-pink-500: rgb(233,30,99); -$palette-pink-600: rgb(216,27,96); -$palette-pink-700: rgb(194,24,91); -$palette-pink-800: rgb(173,20,87); -$palette-pink-900: rgb(136,14,79); -$palette-pink-a100: rgb(255,128,171); -$palette-pink-a200: rgb(255,64,129); -$palette-pink-a400: rgb(245,0,87); -$palette-pink-a700: rgb(197,17,98); - -// Purple -$palette-purple-50: rgb(243,229,245); -$palette-purple-100: rgb(225,190,231); -$palette-purple-200: rgb(206,147,216); -$palette-purple-300: rgb(186,104,200); -$palette-purple-400: rgb(171,71,188); -$palette-purple-500: rgb(156,39,176); -$palette-purple-600: rgb(142,36,170); -$palette-purple-700: rgb(123,31,162); -$palette-purple-800: rgb(106,27,154); -$palette-purple-900: rgb(74,20,140); -$palette-purple-a100: rgb(234,128,252); -$palette-purple-a200: rgb(224,64,251); -$palette-purple-a400: rgb(213,0,249); -$palette-purple-a700: rgb(170,0,255); - -//Deep Purple -$palette-deep-purple-50: rgb(237,231,246); -$palette-deep-purple-100: rgb(209,196,233); -$palette-deep-purple-200: rgb(179,157,219); -$palette-deep-purple-300: rgb(149,117,205); -$palette-deep-purple-400: rgb(126,87,194); -$palette-deep-purple-500: rgb(103,58,183); -$palette-deep-purple-600: rgb(94,53,177); -$palette-deep-purple-700: rgb(81,45,168); -$palette-deep-purple-800: rgb(69,39,160); -$palette-deep-purple-900: rgb(49,27,146); -$palette-deep-purple-a100: rgb(179,136,255); -$palette-deep-purple-a200: rgb(124,77,255); -$palette-deep-purple-a400: rgb(101,31,255); -$palette-deep-purple-a700: rgb(98,0,234); - -// Indigo -$palette-indigo-50: rgb(232,234,246); -$palette-indigo-100: rgb(197,202,233); -$palette-indigo-200: rgb(159,168,218); -$palette-indigo-300: rgb(121,134,203); -$palette-indigo-400: rgb(92,107,192); -$palette-indigo-500: rgb(63,81,181); -$palette-indigo-600: rgb(57,73,171); -$palette-indigo-700: rgb(48,63,159); -$palette-indigo-800: rgb(40,53,147); -$palette-indigo-900: rgb(26,35,126); -$palette-indigo-a100: rgb(140,158,255); -$palette-indigo-a200: rgb(83,109,254); -$palette-indigo-a400: rgb(61,90,254); -$palette-indigo-a700: rgb(48,79,254); - -// Blue -$palette-blue-50: rgb(227,242,253); -$palette-blue-100: rgb(187,222,251); -$palette-blue-200: rgb(144,202,249); -$palette-blue-300: rgb(100,181,246); -$palette-blue-400: rgb(66,165,245); -$palette-blue-500: rgb(33,150,243); -$palette-blue-600: rgb(30,136,229); -$palette-blue-700: rgb(25,118,210); -$palette-blue-800: rgb(21,101,192); -$palette-blue-900: rgb(13,71,161); -$palette-blue-a100: rgb(130,177,255); -$palette-blue-a200: rgb(68,138,255); -$palette-blue-a400: rgb(41,121,255); -$palette-blue-a700: rgb(41,98,255); - -// Light Blue -$palette-light-blue-50: rgb(225,245,254); -$palette-light-blue-100: rgb(179,229,252); -$palette-light-blue-200: rgb(129,212,250); -$palette-light-blue-300: rgb(79,195,247); -$palette-light-blue-400: rgb(41,182,246); -$palette-light-blue-500: rgb(3,169,244); -$palette-light-blue-600: rgb(3,155,229); -$palette-light-blue-700: rgb(2,136,209); -$palette-light-blue-800: rgb(2,119,189); -$palette-light-blue-900: rgb(1,87,155); -$palette-light-blue-a100: rgb(128,216,255); -$palette-light-blue-a200: rgb(64,196,255); -$palette-light-blue-a400: rgb(0,176,255); -$palette-light-blue-a700: rgb(0,145,234); - -// Cyan -$palette-cyan-50: rgb(224,247,250); -$palette-cyan-100: rgb(178,235,242); -$palette-cyan-200: rgb(128,222,234); -$palette-cyan-300: rgb(77,208,225); -$palette-cyan-400: rgb(38,198,218); -$palette-cyan-500: rgb(0,188,212); -$palette-cyan-600: rgb(0,172,193); -$palette-cyan-700: rgb(0,151,167); -$palette-cyan-800: rgb(0,131,143); -$palette-cyan-900: rgb(0,96,100); -$palette-cyan-a100: rgb(132,255,255); -$palette-cyan-a200: rgb(24,255,255); -$palette-cyan-a400: rgb(0,229,255); -$palette-cyan-a700: rgb(0,184,212); - -// Teal -$palette-teal-50: rgb(224,242,241); -$palette-teal-100: rgb(178,223,219); -$palette-teal-200: rgb(128,203,196); -$palette-teal-300: rgb(77,182,172); -$palette-teal-400: rgb(38,166,154); -$palette-teal-500: rgb(0,150,136); -$palette-teal-600: rgb(0,137,123); -$palette-teal-700: rgb(0,121,107); -$palette-teal-800: rgb(0,105,92); -$palette-teal-900: rgb(0,77,64); -$palette-teal-a100: rgb(167,255,235); -$palette-teal-a200: rgb(100,255,218); -$palette-teal-a400: rgb(29,233,182); -$palette-teal-a700: rgb(0,191,165); - -// Green -$palette-green-50: rgb(232,245,233); -$palette-green-100: rgb(200,230,201); -$palette-green-200: rgb(165,214,167); -$palette-green-300: rgb(129,199,132); -$palette-green-400: rgb(102,187,106); -$palette-green-500: rgb(76,175,80); -$palette-green-600: rgb(67,160,71); -$palette-green-700: rgb(56,142,60); -$palette-green-800: rgb(46,125,50); -$palette-green-900: rgb(27,94,32); -$palette-green-a100: rgb(185,246,202); -$palette-green-a200: rgb(105,240,174); -$palette-green-a400: rgb(0,230,118); -$palette-green-a700: rgb(0,200,83); - -// Green -$palette-light-green-50: rgb(241,248,233); -$palette-light-green-100: rgb(220,237,200); -$palette-light-green-200: rgb(197,225,165); -$palette-light-green-300: rgb(174,213,129); -$palette-light-green-400: rgb(156,204,101); -$palette-light-green-500: rgb(139,195,74); -$palette-light-green-600: rgb(124,179,66); -$palette-light-green-700: rgb(104,159,56); -$palette-light-green-800: rgb(85,139,47); -$palette-light-green-900: rgb(51,105,30); -$palette-light-green-a100: rgb(204,255,144); -$palette-light-green-a200: rgb(178,255,89); -$palette-light-green-a400: rgb(118,255,3); -$palette-light-green-a700: rgb(100,221,23); - -// Lime -$palette-lime-50: rgb(249,251,231); -$palette-lime-100: rgb(240,244,195); -$palette-lime-200: rgb(230,238,156); -$palette-lime-300: rgb(220,231,117); -$palette-lime-400: rgb(212,225,87); -$palette-lime-500: rgb(205,220,57); -$palette-lime-600: rgb(192,202,51); -$palette-lime-700: rgb(175,180,43); -$palette-lime-800: rgb(158,157,36); -$palette-lime-900: rgb(130,119,23); -$palette-lime-a100: rgb(244,255,129); -$palette-lime-a200: rgb(238,255,65); -$palette-lime-a400: rgb(198,255,0); -$palette-lime-a700: rgb(174,234,0); - -// Yellow -$palette-yellow-50: rgb(255,253,231); -$palette-yellow-100: rgb(255,249,196); -$palette-yellow-200: rgb(255,245,157); -$palette-yellow-300: rgb(255,241,118); -$palette-yellow-400: rgb(255,238,88); -$palette-yellow-500: rgb(255,235,59); -$palette-yellow-600: rgb(253,216,53); -$palette-yellow-700: rgb(251,192,45); -$palette-yellow-800: rgb(249,168,37); -$palette-yellow-900: rgb(245,127,23); -$palette-yellow-a100: rgb(255,255,141); -$palette-yellow-a200: rgb(255,255,0); -$palette-yellow-a400: rgb(255,234,0); -$palette-yellow-a700: rgb(255,214,0); - -// Amber -$palette-amber-50: rgb(255,248,225); -$palette-amber-100: rgb(255,236,179); -$palette-amber-200: rgb(255,224,130); -$palette-amber-300: rgb(255,213,79); -$palette-amber-400: rgb(255,202,40); -$palette-amber-500: rgb(255,193,7); -$palette-amber-600: rgb(255,179,0); -$palette-amber-700: rgb(255,160,0); -$palette-amber-800: rgb(255,143,0); -$palette-amber-900: rgb(255,111,0); -$palette-amber-a100: rgb(255,229,127); -$palette-amber-a200: rgb(255,215,64); -$palette-amber-a400: rgb(255,196,0); -$palette-amber-a700: rgb(255,171,0); - -// Orange -$palette-orange-50: rgb(255,243,224); -$palette-orange-100: rgb(255,224,178); -$palette-orange-200: rgb(255,204,128); -$palette-orange-300: rgb(255,183,77); -$palette-orange-400: rgb(255,167,38); -$palette-orange-500: rgb(255,152,0); -$palette-orange-600: rgb(251,140,0); -$palette-orange-700: rgb(245,124,0); -$palette-orange-800: rgb(239,108,0); -$palette-orange-900: rgb(230,81,0); -$palette-orange-a100: rgb(255,209,128); -$palette-orange-a200: rgb(255,171,64); -$palette-orange-a400: rgb(255,145,0); -$palette-orange-a700: rgb(255,109,0); - -// Deep Orange -$palette-deep-orange-50: rgb(251,233,231); -$palette-deep-orange-100: rgb(255,204,188); -$palette-deep-orange-200: rgb(255,171,145); -$palette-deep-orange-300: rgb(255,138,101); -$palette-deep-orange-400: rgb(255,112,67); -$palette-deep-orange-500: rgb(255,87,34); -$palette-deep-orange-600: rgb(244,81,30); -$palette-deep-orange-700: rgb(230,74,25); -$palette-deep-orange-800: rgb(216,67,21); -$palette-deep-orange-900: rgb(191,54,12); -$palette-deep-orange-a100: rgb(255,158,128); -$palette-deep-orange-a200: rgb(255,110,64); -$palette-deep-orange-a400: rgb(255,61,0); -$palette-deep-orange-a700: rgb(221,44,0); - -// Brown -$palette-brown-50: rgb(239,235,233); -$palette-brown-100: rgb(215,204,200); -$palette-brown-200: rgb(188,170,164); -$palette-brown-300: rgb(161,136,127); -$palette-brown-400: rgb(141,110,99); -$palette-brown-500: rgb(121,85,72); -$palette-brown-600: rgb(109,76,65); -$palette-brown-700: rgb(93,64,55); -$palette-brown-800: rgb(78,52,46); -$palette-brown-900: rgb(62,39,35); - -// Grey -$palette-grey-50: rgb(250,250,250); -$palette-grey-100: rgb(245,245,245); -$palette-grey-200: rgb(238,238,238); -$palette-grey-300: rgb(224,224,224); -$palette-grey-400: rgb(189,189,189); -$palette-grey-500: rgb(158,158,158); -$palette-grey-600: rgb(117,117,117); -$palette-grey-700: rgb(97,97,97); -$palette-grey-800: rgb(66,66,66); -$palette-grey-900: rgb(33,33,33); - -// Blue Grey -$palette-blue-grey-50: rgb(236,239,241); -$palette-blue-grey-100: rgb(207,216,220); -$palette-blue-grey-200: rgb(176,190,197); -$palette-blue-grey-300: rgb(144,164,174); -$palette-blue-grey-400: rgb(120,144,156); -$palette-blue-grey-500: rgb(96,125,139); -$palette-blue-grey-600: rgb(84,110,122); -$palette-blue-grey-700: rgb(69,90,100); -$palette-blue-grey-800: rgb(55,71,79); -$palette-blue-grey-900: rgb(38,50,56); - -$color-black: rgb(0,0,0); -$color-white: rgb(255,255,255); - -//-- The two possible colors for overlayed text. -$styleguide-generate-template: false !default; -$color-dark-contrast: $color-white !default; -$color-light-contrast: $color-black !default; diff --git a/components/_globals.scss b/components/_globals.scss deleted file mode 100644 index 73edd5f9..00000000 --- a/components/_globals.scss +++ /dev/null @@ -1,81 +0,0 @@ -//-- Color configuration -$color-divider: $palette-grey-200 !default; -$color-background: $color-white !default; -$color-text: $palette-grey-900 !default; -$color-text-secondary: $palette-grey-600 !default; - -$color-primary: $palette-indigo-500 !default; -$color-primary-dark: $palette-indigo-700 !default; -$color-accent: $palette-pink-a200 !default; -$color-accent-dark: $palette-pink-700 !default; -$color-primary-contrast: $color-dark-contrast !default; -$color-accent-contrast: $color-dark-contrast !default; - -//-- Sizing -$unit: 1rem !default; - -// -- Fonts -$preferred-font: "Roboto", "Helvetica", "Arial", sans-serif !default; -$font-size: 1.6 * $unit !default; -$font-size-tiny: 1.2 * $unit !default; -$font-size-small: 1.4 * $unit !default; -$font-size-normal: $font-size !default; -$font-size-big: 1.8 * $unit !default; -$font-weight-thin: 300 !default; -$font-weight-normal: 400 !default; -$font-weight-semi-bold: 500 !default; -$font-weight-bold: 700 !default; - -//-- Shadows -$shadow-key-umbra-opacity: 0.2 !default; -$shadow-key-penumbra-opacity: 0.14 !default; -$shadow-ambient-shadow-opacity: 0.12 !default; - -//-- Depth Shadows -$zdepth-shadow-1: 0 1px 6px rgba(0,0,0,.12), 0 1px 4px rgba(0,0,0,.24); -$zdepth-shadow-2: 0 3px 10px rgba(0,0,0,.16), 0 3px 10px rgba(0,0,0,.23); -$zdepth-shadow-3: 0 10px 30px rgba(0,0,0,.19), 0 6px 10px rgba(0,0,0,.23); -$zdepth-shadow-4: 0 14px 45px rgba(0,0,0,.25), 0 10px 18px rgba(0,0,0,.22); -$zdepth-shadow-5: 0 19px 60px rgba(0,0,0,.3), 0 15px 20px rgba(0,0,0,.22); - -//-- Animation -$animation-duration: .35s; -$animation-delay: $animation-duration / 5; -$animation-curve-fast-out-slow-in: cubic-bezier(0.4, 0, 0.2, 1) !default; -$animation-curve-linear-out-slow-in: cubic-bezier(0, 0, 0.2, 1) !default; -$animation-curve-fast-out-linear-in: cubic-bezier(0.4, 0, 1, 1) !default; -$animation-curve-default: $animation-curve-fast-out-slow-in !default; - -//-- Indexes -$z-index-highest: 300 !default; -$z-index-higher: 200 !default; -$z-index-high: 100 !default; -$z-index-normal: 1 !default; -$z-index-low: -100 !default; -$z-index-lower: -200 !default; - -//-- Breakpoints -// height of app bar -// https://material.google.com/layout/metrics-keylines.html#metrics-keylines-keylines-spacing -$standard-increment-mobile: (5.6 * $unit) !default; -$standard-increment-desktop: (6.4 * $unit) !default; - -// https://material.google.com/layout/metrics-keylines.html#metrics-keylines-baseline-grids -$baseline-grid: (0.8 * $unit) !default; -$layout-gutter-width-sm: ($baseline-grid * 2) !default; -$layout-gutter-width: ($baseline-grid * 3) !default; - -// https://material.google.com/layout/responsive-ui.html#responsive-ui-breakpoints -// 4 columns -$layout-breakpoint-xxs: 480px !default; -// 8 columns -$layout-breakpoint-xs: 600px !default; -// 12 columns -$layout-breakpoint-sm-tablet: 720px !default; -$layout-breakpoint-sm: 840px !default; -$layout-breakpoint-md: 960px !default; -$layout-breakpoint-lg-tablet: 1024px !default; -$layout-breakpoint-lg: 1280px !default; -$layout-breakpoint-xl: 1440px !default; -$layout-breakpoint-xxl: 1600px !default; -$layout-breakpoint-xxxl: 1920px !default; diff --git a/components/_mixins.scss b/components/_mixins.scss deleted file mode 100644 index 40490c70..00000000 --- a/components/_mixins.scss +++ /dev/null @@ -1,260 +0,0 @@ -// scss-lint:disable VendorPrefix -@mixin typo-preferred-font($use-preferred: true) { - @if $use-preferred { - font-family: $preferred-font; - } -} - -@mixin typo-display-4($color-contrast: false, $use-preferred: true) { - @include typo-preferred-font($use-preferred); - font-size: $unit * 11.2; - font-weight: 300; - line-height: 1; - letter-spacing: -.04em; - - @if $color-contrast { - opacity: .54; - } -} - -@mixin typo-display-3($color-contrast: false, $use-preferred: true) { - @include typo-preferred-font($use-preferred); - font-size: $unit * 5.6; - font-weight: 400; - line-height: 1.35; - letter-spacing: -.02em; - - @if $color-contrast { - opacity: .54; - } -} - -@mixin typo-display-2($color-contrast: false, $use-preferred: true) { - @include typo-preferred-font($use-preferred); - font-size: $unit * 4.5; - font-weight: 400; - line-height: $unit * 4.8; - - @if $color-contrast { - opacity: .54; - } -} - -@mixin typo-display-1($color-contrast: false, $use-preferred: true) { - @include typo-preferred-font($use-preferred); - font-size: $unit * 3.4; - font-weight: 400; - line-height: $unit * 4; - - @if $color-contrast { - opacity: .54; - } -} - -@mixin typo-headline($color-contrast: false, $use-preferred: true) { - @include typo-preferred-font($use-preferred); - font-size: $unit * 2.4; - font-weight: 400; - line-height: $unit * 3.2; - -moz-osx-font-smoothing: grayscale; - - @if $color-contrast { - opacity: .87; - } -} - -@mixin typo-title($color-contrast: false, $use-preferred: true) { - @include typo-preferred-font($use-preferred); - font-size: $unit * 2; - font-weight: 500; - line-height: 1; - letter-spacing: .02em; - - @if $color-contrast { - opacity: .87; - } -} - -@mixin typo-subhead($color-contrast: false, $use-preferred: true) { - @include typo-preferred-font($use-preferred); - font-size: $unit * 1.6; - font-weight: 400; - line-height: $unit * 2.4; - letter-spacing: .04em; - - @if $color-contrast { - opacity: .87; - } -} - -@mixin typo-subhead-2($color-contrast: false, $use-preferred: true) { - @include typo-preferred-font($use-preferred); - font-size: $unit * 1.6; - font-weight: 400; - line-height: $unit * 2.8; - letter-spacing: .04em; - - @if $color-contrast { - opacity: .87; - } -} - -@mixin typo-body-2($color-contrast: false, $use-preferred: false) { - @include typo-preferred-font($use-preferred); - font-size: $unit * 1.4; - line-height: $unit * 2.4; - letter-spacing: 0; - - @if $use-preferred { - font-weight: 500; - } @else { - font-weight: bold; - } - - @if $color-contrast { - opacity: .87; - } -} - -@mixin typo-body-1($color-contrast: false, $use-preferred: false) { - @include typo-preferred-font($use-preferred); - font-size: $unit * 1.4; - font-weight: 400; - line-height: $unit * 2.4; - letter-spacing: 0; - - @if $color-contrast { - opacity: .87; - } -} - -@mixin typo-caption($color-contrast: false, $use-preferred: false) { - @include typo-preferred-font($use-preferred); - font-size: $unit * 1.2; - font-weight: 400; - line-height: 1; - letter-spacing: 0; - - @if $color-contrast { - opacity: .54; - } -} - -@mixin typo-blockquote($color-contrast: false, $use-preferred: true) { - @include typo-preferred-font($use-preferred); - position: relative; - font-size: $unit * 2.4; - font-style: italic; - font-weight: 300; - line-height: 1.35; - letter-spacing: .08em; - - &:before { - position: absolute; - left: -.5em; - content: "“"; - } - - &:after { - margin-left: -.05em; - content: "”"; - } - - @if $color-contrast { - opacity: .54; - } -} - -@mixin typo-menu($color-contrast: false, $use-preferred: true) { - @include typo-preferred-font($use-preferred); - font-size: $unit * 1.4; - font-weight: 500; - line-height: 1; - letter-spacing: 0; - - @if $color-contrast { - opacity: .87; - } -} - -@mixin typo-button($color-contrast: false, $use-preferred: true) { - @include typo-preferred-font($use-preferred); - font-size: $unit * 1.4; - font-weight: 500; - line-height: 1; - text-transform: uppercase; - letter-spacing: 0; - - @if $color-contrast { - opacity: .87; - } -} - -//-- Shadows -@mixin focus-shadow() { - box-shadow: 0 0 8px rgba(0, 0, 0, .18), 0 8px 16px rgba(0, 0, 0, .36); -} - -@mixin shadow-2dp() { - box-shadow: 0 2px 2px 0 rgba(0, 0, 0, $shadow-key-penumbra-opacity), - 0 3px 1px -2px rgba(0, 0, 0, $shadow-key-umbra-opacity), - 0 1px 5px 0 rgba(0, 0, 0, $shadow-ambient-shadow-opacity); -} - -@mixin shadow-3dp() { - box-shadow: 0 3px 4px 0 rgba(0, 0, 0, $shadow-key-penumbra-opacity), - 0 3px 3px -2px rgba(0, 0, 0, $shadow-key-umbra-opacity), - 0 1px 8px 0 rgba(0, 0, 0, $shadow-ambient-shadow-opacity); -} - -@mixin shadow-4dp() { - box-shadow: 0 4px 5px 0 rgba(0, 0, 0, $shadow-key-penumbra-opacity), - 0 1px 10px 0 rgba(0, 0, 0, $shadow-ambient-shadow-opacity), - 0 2px 4px -1px rgba(0, 0, 0, $shadow-key-umbra-opacity); -} - -@mixin shadow-6dp() { - box-shadow: 0 6px 10px 0 rgba(0, 0, 0, $shadow-key-penumbra-opacity), - 0 1px 18px 0 rgba(0, 0, 0, $shadow-ambient-shadow-opacity), - 0 3px 5px -1px rgba(0, 0, 0, $shadow-key-umbra-opacity); -} - -@mixin shadow-8dp() { - box-shadow: 0 8px 10px 1px rgba(0, 0, 0, $shadow-key-penumbra-opacity), - 0 3px 14px 2px rgba(0, 0, 0, $shadow-ambient-shadow-opacity), - 0 5px 5px -3px rgba(0, 0, 0, $shadow-key-umbra-opacity); -} - -@mixin shadow-16dp() { - box-shadow: 0 16px 24px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity), - 0 6px 30px 5px rgba(0, 0, 0, $shadow-ambient-shadow-opacity), - 0 8px 10px -5px rgba(0, 0, 0, $shadow-key-umbra-opacity); -} - -//-- Animations -@mixin material-animation-fast-out-slow-in($duration: .2s) { - transition-timing-function: $animation-curve-fast-out-slow-in; - transition-duration: $duration; -} - -@mixin material-animation-linear-out-slow-in($duration: .2s) { - transition-timing-function: $animation-curve-linear-out-slow-in; - transition-duration: $duration; -} - -@mixin material-animation-fast-out-linear-in($duration: .2s) { - transition-timing-function: $animation-curve-fast-out-linear-in; - transition-duration: $duration; -} - -@mixin material-animation-default($duration: .2s) { - transition-timing-function: $animation-curve-default; - transition-duration: $duration; -} - -@mixin no-webkit-scrollbar { - &::-webkit-scrollbar { - width: 0; - height: 0; - } -} diff --git a/components/animations/index.js b/components/animations/index.js deleted file mode 100644 index 3ab27eca..00000000 --- a/components/animations/index.js +++ /dev/null @@ -1,4 +0,0 @@ -export SlideLeft from './slide-left.scss'; -export SlideRight from './slide-right.scss'; -export ZoomIn from './zoom-in.scss'; -export ZoomOut from './zoom-out.scss'; diff --git a/components/animations/slide-left.scss b/components/animations/slide-left.scss deleted file mode 100644 index aba03995..00000000 --- a/components/animations/slide-left.scss +++ /dev/null @@ -1,26 +0,0 @@ -.enter, .leave { - position: absolute; - transition-timing-function: ease-in-out; - transition-duration: .35s; - transition-property: transform, opacity; -} - -.enter { - opacity: 0; - transform: translate3d(-100%, 0, 0); - - &.enterActive { - opacity: 1; - transform: translate3d(0, 0, 0); - } -} - -.leave { - opacity: 1; - transform: translate3d(0, 0, 0); - - &.leaveActive { - opacity: 0; - transform: translate3d(100%, 0, 0); - } -} diff --git a/components/animations/slide-right.scss b/components/animations/slide-right.scss deleted file mode 100644 index 95d0e15d..00000000 --- a/components/animations/slide-right.scss +++ /dev/null @@ -1,29 +0,0 @@ -.enter, .leave { - position: absolute; -} - -.enterActive, .leaveActive { - transition-timing-function: ease-in-out; - transition-duration: 350ms; - transition-property: transform, opacity; -} - -.enter { - opacity: 0; - transform: translateX(100%); - - &.enterActive { - opacity: 1; - transform: translateX(0); - } -} - -.leave { - opacity: 1; - transform: translateX(0); - - &.leaveActive { - opacity: 0; - transform: translateX(-100%); - } -} diff --git a/components/animations/zoom-in.scss b/components/animations/zoom-in.scss deleted file mode 100644 index d752e940..00000000 --- a/components/animations/zoom-in.scss +++ /dev/null @@ -1,33 +0,0 @@ -@import "../colors"; -@import "../globals"; -@import "../mixins"; - -.enter, .leave { - position: absolute; -} - -.enterActive, .leaveActive { - transition: transform, opacity; - transition-timing-function: $animation-curve-fast-out-slow-in; - transition-duration: 500ms; -} - -.enter { - opacity: 0; - transform: scale(0.85); - - &.enterActive { - opacity: 1; - transform: scale(1); - } -} - -.leave { - opacity: 1; - transform: scale(1); - - &.leaveActive { - opacity: 0; - transform: scale(1.25); - } -} diff --git a/components/animations/zoom-out.scss b/components/animations/zoom-out.scss deleted file mode 100644 index cf1500fc..00000000 --- a/components/animations/zoom-out.scss +++ /dev/null @@ -1,33 +0,0 @@ -@import "../colors"; -@import "../globals"; -@import "../mixins"; - -.enter, .leave { - position: absolute; -} - -.enterActive, .leaveActive { - transition: transform, opacity; - transition-timing-function: $animation-curve-fast-out-slow-in; - transition-duration: 500ms; -} - -.enter { - opacity: 0; - transform: scale(1.25); - - &.enterActive { - opacity: 1; - transform: scale(1); - } -} - -.leave { - opacity: 1; - transform: scale(1); - - &.leaveActive { - opacity: 0; - transform: scale(0.85); - } -} diff --git a/components/app_bar/AppBar.js b/components/app_bar/AppBar.js index 60da12b9..4146158c 100644 --- a/components/app_bar/AppBar.js +++ b/components/app_bar/AppBar.js @@ -24,6 +24,7 @@ const factory = (IconButton) => { scrollHide: PropTypes.bool, theme: PropTypes.shape({ appBar: PropTypes.string, + inner: PropTypes.string, fixed: PropTypes.string, flat: PropTypes.string, leftIcon: PropTypes.string, @@ -97,20 +98,22 @@ const factory = (IconButton) => { data-react-toolbox='app-bar' ref={node => {this.rootNode = node;}} > - {leftIcon && - } - {title &&

{title}

} - {children} - {rightIcon && - } +
+ {leftIcon && + } + {title &&

{title}

} + {children} + {rightIcon && + } +
); } diff --git a/components/app_bar/_config.scss b/components/app_bar/_config.scss deleted file mode 100644 index 5c76b618..00000000 --- a/components/app_bar/_config.scss +++ /dev/null @@ -1,8 +0,0 @@ -$appbar-color: $color-primary-dark !default; -$appbar-contrast: $color-primary-contrast !default; -$appbar-title-total-distance: 8 * $unit !default; -$appbar-height: 6.4 * $unit !default; -$appbar-height-m-portrait: 5.6 * $unit !default; -$appbar-height-m-landscape: 4.8 * $unit !default; -$appbar-h-padding: 2.4 * $unit !default; -$appbar-title-distance: $appbar-title-total-distance - $appbar-h-padding !default; diff --git a/components/app_bar/config.css b/components/app_bar/config.css new file mode 100644 index 00000000..ca3ba1b4 --- /dev/null +++ b/components/app_bar/config.css @@ -0,0 +1,10 @@ +:root { + --appbar-color: var(--color-primary-dark); + --appbar-contrast: var(--color-primary-contrast); + --appbar-title-total-distance: calc(8 * var(--unit)); + --appbar-height: calc(6.4 * var(--unit)); + --appbar-height-m-portrait: calc(5.6 * var(--unit)); + --appbar-height-m-landscape: calc(4.8 * var(--unit)); + --appbar-h-padding: calc(2.4 * var(--unit)); + --appbar-title-distance: calc(var(--appbar-title-total-distance) - var(--appbar-h-padding)); +} diff --git a/components/app_bar/index.js b/components/app_bar/index.js index ff38bf7c..83d10d8e 100644 --- a/components/app_bar/index.js +++ b/components/app_bar/index.js @@ -2,7 +2,7 @@ import { themr } from 'react-css-themr'; import { APP_BAR } from '../identifiers.js'; import { appBarFactory } from './AppBar.js'; import { IconButton } from '../button'; -import theme from './theme.scss'; +import theme from './theme.css'; const AppBar = appBarFactory(IconButton); const ThemedAppBar = themr(APP_BAR, theme)(AppBar); diff --git a/components/app_bar/readme.md b/components/app_bar/readme.md index f68ecf12..3f1b3f92 100644 --- a/components/app_bar/readme.md +++ b/components/app_bar/readme.md @@ -50,6 +50,7 @@ The `AppBar` component provides properties for the common use cases of `title`, | `appBar` | Used for the component root element.| | `fixed` | Added to the root element when the app bar is fixed.| | `flat` | Added to the root element when the app bar is flat.| +| `inner` | Added to a wrapper to the component main content.| | `title` | Added to the title element of the app bar.| | `leftIcon` | Added to the left icon element when the app bar.| | `rightIcon` | Added to the right icon element when the app bar.| diff --git a/components/app_bar/theme.css b/components/app_bar/theme.css new file mode 100644 index 00000000..4dfcf3ab --- /dev/null +++ b/components/app_bar/theme.css @@ -0,0 +1,76 @@ +@import '../colors.css'; +@import '../media.css'; +@import '../variables.css'; +@import './config.css'; + +.appBar { + background: var(--appbar-color); + color: var(--appbar-contrast); + composes: reset from '../helpers.css'; + font-family: var(--preferred-font); + height: var(--appbar-height); + padding: 0 var(--appbar-h-padding); + transition-duration: 0.5s; + transition-property: transform; + transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + + &.scrollHide { + transform: translateY(-100%); + } + + &:not(.flat) { + box-shadow: var(--shadow-4p); + z-index: var(--z-index-high); + } + + &.fixed { + left: 0; + position: fixed; + right: 0; + top: 0; + z-index: var(--z-index-highest); + } + + & .inner { + align-items: center; + display: flex; + height: 100%; + position: relative; + width: 100%; + } + + & a { + color: var(--appbar-contrast); + } + + @media screen and (--xxs-viewport) and (--portrait) { + height: var(--appbar-height-m-portrait); + } + + @media screen and (--xs-viewport) and (--landscape) { + height: var(--appbar-height-m-landscape); + } +} + +.title { + flex-grow: 1; + font-size: calc(1.8 * var(--unit)); + font-weight: bold; + overflow-x: hidden; + text-overflow: ellipsis; + white-space: nowrap; + + & > small { + font-size: calc(1.8 * var(--unit)); + font-weight: normal; + } +} + +.leftIcon { + margin-left: calc(-1.2 * var(--unit)); +} + +.rightIcon { + margin-left: auto; + margin-right: calc(-1.2 * var(--unit)); +} diff --git a/components/app_bar/theme.scss b/components/app_bar/theme.scss deleted file mode 100644 index 04584eb6..00000000 --- a/components/app_bar/theme.scss +++ /dev/null @@ -1,65 +0,0 @@ -@import "../colors"; -@import "../globals"; -@import "../mixins"; -@import "./config"; - -.appBar { - display: flex; - height: $appbar-height; - align-items: center; - padding: 0 $appbar-h-padding; - color: $appbar-contrast; - background: $appbar-color; - - @media screen and (max-width: $layout-breakpoint-xxs) and (orientation: portrait) { - height: $appbar-height-m-portrait; - } - - @media screen and (max-width: $layout-breakpoint-xs) and (orientation: landscape) { - height: $appbar-height-m-landscape; - } - - &:not(.flat) { - z-index: $z-index-high; - box-shadow: 0 2px 5px rgba(0,0,0,.26); - } - - &.fixed { - position: fixed; - top: 0; - right: 0; - left: 0; - z-index: $z-index-highest; - } - - a { - color: $appbar-contrast; - } - - .title { - flex-grow: 1; - font-size: 1.8 * $unit; - font-weight: bold; - > small { - font-size: 1.8 * $unit; - font-weight: normal; - } - } - - .leftIcon { - margin-left: -1.2 * $unit; - } - - .rightIcon { - margin-right: -1.2 * $unit; - margin-left: auto; - } - - transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); - transition-duration: .5s; - transition-property: transform; - - &.scrollHide { - transform: translateY(-100%); - } -} diff --git a/components/autocomplete/_config.scss b/components/autocomplete/_config.scss deleted file mode 100644 index e0280558..00000000 --- a/components/autocomplete/_config.scss +++ /dev/null @@ -1,7 +0,0 @@ -$autocomplete-color-primary-contrast: $color-primary-contrast !default; -$autocomplete-color-primary: $color-primary !default; -$autocomplete-overflow-max-height: 45vh !default; -$autocomplete-suggestion-active-background: $palette-grey-200 !default; -$autocomplete-suggestion-padding: $unit !default; -$autocomplete-suggestions-background: $color-white !default; -$autocomplete-value-margin: $unit * .25 $unit * .5 $unit * .25 0 !default; diff --git a/components/autocomplete/config.css b/components/autocomplete/config.css new file mode 100644 index 00000000..2f98ac0d --- /dev/null +++ b/components/autocomplete/config.css @@ -0,0 +1,10 @@ +:root { + --autocomplete-border-size: calc(var(--input-field-height) / 7); + --autocomplete-color-primary-contrast: var(--color-primary-contrast); + --autocomplete-color-primary: var(--color-primary); + --autocomplete-overflow-max-height: 45vh; + --autocomplete-suggestion-active-background: var(--palette-grey-200); + --autocomplete-suggestion-padding: var(--unit); + --autocomplete-suggestions-background: var(--color-white); + --autocomplete-value-margin: calc(var(--unit) * 0.25) calc(var(--unit) * 0.5) calc(var(--unit) * 0.25) 0; +} diff --git a/components/autocomplete/index.js b/components/autocomplete/index.js index fce2d72d..1f0842ed 100644 --- a/components/autocomplete/index.js +++ b/components/autocomplete/index.js @@ -3,7 +3,7 @@ import { themr } from 'react-css-themr'; import { autocompleteFactory } from './Autocomplete.js'; import Chip from '../chip'; import Input from '../input'; -import theme from './theme.scss'; +import theme from './theme.css'; const Autocomplete = autocompleteFactory(Chip, Input); const ThemedAutocomplete = themr(AUTOCOMPLETE, theme)(Autocomplete); diff --git a/components/autocomplete/theme.css b/components/autocomplete/theme.css new file mode 100644 index 00000000..4c4ef2be --- /dev/null +++ b/components/autocomplete/theme.css @@ -0,0 +1,87 @@ +@import '../colors.css'; +@import '../variables.css'; +@import '../input/config.css'; +@import './config.css'; + +.autocomplete { + composes: reset from '../helpers.css'; + padding: var(--unit) 0; + position: relative; + + &.focus { + & .suggestions { + box-shadow: var(--zdepth-shadow-1); + max-height: var(--autocomplete-overflow-max-height); + visibility: visible; + } + } +} + +.values { + flex-direction: row; + flex-wrap: wrap; + list-style: none; + margin: 0; + padding: 0 0 calc(var(--unit) / 2) 0; +} + +.value { + margin: var(--autocomplete-value-margin); +} + +.suggestions { + background-color: var(--autocomplete-suggestions-background); + list-style: none; + max-height: 0; + overflow-x: hidden; + overflow-y: auto; + padding: 0; + position: absolute; + transition-duration: var(--animation-duration); + transition-property: max-height, box-shadow; + transition-timing-function: var(--animation-curve-default); + visibility: hidden; + width: 100%; + z-index: var(--z-index-high); + + &:not(.up) { + margin-top: calc(-1 * var(--input-padding)); + } + + &.up { + bottom: 0; + } + + &::-webkit-scrollbar { + height: 0; + width: 0; + } +} + +.suggestion { + cursor: pointer; + font-size: var(--input-field-font-size); + padding: var(--autocomplete-suggestion-padding); + + &.active { + background-color: var(--autocomplete-suggestion-active-background); + } +} + +.input { + position: relative; + + &::after { + border-left: var(--autocomplete-border-size) solid transparent; + border-right: var(--autocomplete-border-size) solid transparent; + border-top: var(--autocomplete-border-size) solid var(--input-text-bottom-border-color); + content: ''; + height: 0; + pointer-events: none; + position: absolute; + right: var(--input-chevron-offset); + top: 50%; + transition: transform var(--animation-duration) var(--animation-curve-default); + width: 0; + } +} diff --git a/components/autocomplete/theme.scss b/components/autocomplete/theme.scss deleted file mode 100644 index f1213657..00000000 --- a/components/autocomplete/theme.scss +++ /dev/null @@ -1,76 +0,0 @@ -@import "../colors"; -@import "../globals"; -@import "../mixins"; -@import "./config"; -@import "../input/config"; - -.autocomplete { - position: relative; - padding: $unit 0; - &.focus { - .suggestions { - max-height: $autocomplete-overflow-max-height; - visibility: visible; - box-shadow: $zdepth-shadow-1; - } - } -} - -.values { - flex-direction: row; - flex-wrap: wrap; - padding-bottom: $unit / 2; -} - -.value { - margin: $autocomplete-value-margin; -} - -.suggestions { - @include no-webkit-scrollbar; - position: absolute; - z-index: $z-index-high; - width: 100%; - max-height: 0; - overflow-x: hidden; - overflow-y: auto; - visibility: hidden; - background-color: $autocomplete-suggestions-background; - transition-timing-function: $animation-curve-default; - transition-duration: $animation-duration; - transition-property: max-height, box-shadow; - &:not(.up) { - margin-top: - $input-padding; - } - &.up { - bottom: 0; - } -} - -.suggestion { - padding: $autocomplete-suggestion-padding; - font-size: $input-field-font-size; - cursor: pointer; - &.active { - background-color: $autocomplete-suggestion-active-background; - } -} - -.input { - position: relative; - &:after { - $size: ($input-field-height / 7); - $border: $size solid transparent; - position: absolute; - top: 50%; - right: $input-chevron-offset; - width: 0; - height: 0; - pointer-events: none; - content: ""; - border-top: $size solid $input-text-bottom-border-color; - border-right: $border; - border-left: $border; - transition: transform $animation-duration $animation-curve-default; - } -} diff --git a/components/avatar/_config.scss b/components/avatar/_config.scss deleted file mode 100644 index a2922fb6..00000000 --- a/components/avatar/_config.scss +++ /dev/null @@ -1,4 +0,0 @@ -$avatar-color: $color-white !default; -$avatar-background: $palette-grey-500 !default; -$avatar-size: 4 * $unit !default; -$avatar-font-size: 2.4 * $unit !default; diff --git a/components/avatar/config.css b/components/avatar/config.css new file mode 100644 index 00000000..453d1954 --- /dev/null +++ b/components/avatar/config.css @@ -0,0 +1,6 @@ +:root { + --avatar-color: var(--color-white); + --avatar-background: var(--palette-grey-500); + --avatar-size: calc(4 * var(--unit)); + --avatar-font-size: calc(2.4 * var(--unit)); +} diff --git a/components/avatar/index.js b/components/avatar/index.js index 02ada447..6b2896bc 100644 --- a/components/avatar/index.js +++ b/components/avatar/index.js @@ -2,7 +2,7 @@ import { AVATAR } from '../identifiers.js'; import { themr } from 'react-css-themr'; import { avatarFactory } from './Avatar.js'; import FontIcon from '../font_icon/FontIcon.js'; -import theme from './theme.scss'; +import theme from './theme.css'; const Avatar = avatarFactory(FontIcon); const ThemedAvatar = themr(AVATAR, theme)(Avatar); diff --git a/components/avatar/theme.scss b/components/avatar/theme.css similarity index 55% rename from components/avatar/theme.scss rename to components/avatar/theme.css index 9514782a..a0116991 100644 --- a/components/avatar/theme.scss +++ b/components/avatar/theme.css @@ -1,44 +1,46 @@ -@import "../colors"; -@import "../globals"; -@import "../mixins"; -@import "./config"; +@import '../colors.css'; +@import '../variables.css'; +@import './config.css'; .avatar { - position: relative; + background-color: var(--avatar-background); + border-radius: 50%; + color: var(--avatar-color); + composes: reset from '../helpers.css'; display: inline-block; - width: $avatar-size; - height: $avatar-size; + font-size: var(--avatar-font-size); + height: var(--avatar-size); overflow: hidden; - font-size: $avatar-font-size; - color: $avatar-color; + position: relative; text-align: center; vertical-align: middle; - background-color: $avatar-background; - border-radius: 50%; - > svg { - width: 1em; - height: $avatar-size; + width: var(--avatar-size); + + & > svg { fill: currentColor; + height: var(--avatar-size); + width: 1em; } - > img { - max-width: 100%; + + & > img { height: auto; + max-width: 100%; } } .image { - position: absolute; - display: block; - width: 100%; - height: 100%; background-color: transparent; background-position: center; background-size: cover; border-radius: 50%; + display: block; + height: 100%; + position: absolute; + width: 100%; } .letter { display: block; + line-height: var(--avatar-size); width: 100%; - line-height: $avatar-size; } diff --git a/components/button/__test__/index.spec.js b/components/button/__test__/index.spec.js index 01cb6ca6..e217195d 100644 --- a/components/button/__test__/index.spec.js +++ b/components/button/__test__/index.spec.js @@ -2,7 +2,7 @@ import expect from 'expect'; import React from 'react'; import ReactDOM from 'react-dom'; import TestUtils from 'react-addons-test-utils'; -import theme from '../theme.scss'; +import theme from '../theme.css'; import Button, { Button as RawButton } from '../Button'; const getRenderedClassName = (tree, Component) => { diff --git a/components/button/_config.scss b/components/button/_config.scss deleted file mode 100644 index 98aa2c24..00000000 --- a/components/button/_config.scss +++ /dev/null @@ -1,23 +0,0 @@ -$button-neutral-color: $color-white !default; -$button-neutral-color-contrast: $palette-grey-900 !default; -$button-neutral-color-hover: rgba($palette-grey-900, .2) !default; -$button-primary-color-contrast: $color-primary-contrast !default; -$button-primary-color-hover: rgba($color-primary, .2) !default; -$button-primary-color: $color-primary !default; -$button-accent-color-contrast: $color-primary-contrast !default; -$button-accent-color-hover: rgba($color-accent, .2) !default; -$button-accent-color: $color-accent !default; -$button-disabled-text-color: rgba($color-black, 0.26) !default; -$button-disabled-background-color: rgba($color-black, 0.12) !default; -$button-disabled-text-color-inverse: rgba($color-white, 0.54) !default; -$button-disabled-background-inverse: rgba($color-white, 0.08) !default; -$button-border-radius: 0.2 * $unit !default; -$button-floating-font-size: $unit * 2.4 !default; -$button-floating-height: $unit * 5.6 !default; -$button-floating-mini-height: $unit * 4 !default; -$button-floating-mini-font-size: $button-floating-mini-height / 2.25 !default; -$button-height: $unit * 3.6 !default; -$button-squared-icon-margin: $unit * .6 !default; -$button-squared-min-width: 9 * $unit !default; -$button-squared-padding: 0 $unit * 1.2 !default; -$button-toggle-font-size: $unit * 2 !default; diff --git a/components/button/_mixins.scss b/components/button/_mixins.scss deleted file mode 100644 index 305be037..00000000 --- a/components/button/_mixins.scss +++ /dev/null @@ -1,17 +0,0 @@ -@mixin btn-colors($name, $color, $background, $hover) { - .#{$name}:not([disabled]) { - &.raised, &.floating { - color: $color; - background: $background; - } - &.flat, &.toggle { - color: $background; - &:focus:not(:active) { - background: $hover; - } - } - &.flat:hover { - background: $hover; - } - } -} diff --git a/components/button/config.css b/components/button/config.css new file mode 100644 index 00000000..18865745 --- /dev/null +++ b/components/button/config.css @@ -0,0 +1,25 @@ +:root { + --button-border-radius: calc(0.2 * var(--unit)); + --button-height: calc(3.6 * var(--unit)); + --button-toggle-font-size: calc(2 * var(--unit)); + --button-primary-color: var(--color-primary); + --button-primary-color-hover: color(var(--color-primary) a(20%)); + --button-primary-color-contrast: var(--color-primary-contrast); + --button-accent-color-contrast: var(--color-primary-contrast); + --button-accent-color-hover: color(var(--color-accent) a(20%)); + --button-accent-color: var(--color-accent); + --button-neutral-color: var(--color-white); + --button-neutral-color-contrast: var(--palette-grey-900); + --button-neutral-color-hover: color(var(--palette-grey-900) a(20%)); + --button-floating-font-size: calc(2.4 * var(--unit)); + --button-floating-height: calc(5.6 * var(--unit)); + --button-floating-mini-height: calc(4 * var(--unit)); + --button-floating-mini-font-size: calc(var(--button-floating-mini-height) / 2.25); + --button-disabled-text-color: color(var(--color-black) a(26%)); + --button-disabled-background-color: color(var(--color-black) a(12%)); + --button-disabled-text-color-inverse: color(var(--color-black) a(54%)); + --button-disabled-background-inverse: color(var(--color-black) a(8%)); + --button-squared-icon-margin: calc(0.6 * var(--unit)); + --button-squared-min-width: calc(9 * var(--unit)); + --button-squared-padding: 0 calc(1.2 * var(--unit)); +} diff --git a/components/button/index.js b/components/button/index.js index 126272d2..5baa93eb 100644 --- a/components/button/index.js +++ b/components/button/index.js @@ -5,7 +5,7 @@ import { browseButtonFactory } from './BrowseButton.js'; import { iconButtonFactory } from './IconButton.js'; import FontIcon from '../font_icon/FontIcon.js'; import themedRippleFactory from '../ripple'; -import theme from './theme.scss'; +import theme from './theme.css'; const Button = buttonFactory(themedRippleFactory({ centered: false }), FontIcon); const IconButton = iconButtonFactory(themedRippleFactory({centered: true}), FontIcon); diff --git a/components/button/theme.css b/components/button/theme.css new file mode 100644 index 00000000..78b5402b --- /dev/null +++ b/components/button/theme.css @@ -0,0 +1,258 @@ +@import '../colors.css'; +@import '../variables.css'; +@import './config.css'; + +.button { + align-content: center; + align-items: center; + border: 0; + composes: reset from '../helpers.css'; + cursor: pointer; + display: inline-block; + flex-direction: row; + font-size: calc(1.4 * var(--unit)); + font-weight: 500; + height: var(--button-height); + justify-content: center; + letter-spacing: 0; + line-height: var(--button-height); + outline: none; + padding: 0; + position: relative; + text-align: center; + text-decoration: none; + text-transform: uppercase; + transition: + box-shadow 0.2s var(--animation-curve-fast-out-linear-in), + background-color 0.2s var(--animation-curve-default), + color 0.2s var(--animation-curve-default); + white-space: nowrap; + + & > input { + height: 0.1px; + margin: 0; + opacity: 0; + overflow: hidden; + padding: 0; + position: absolute; + width: 0.1px; + z-index: 0; + } + + &::-moz-focus-inner { + border: 0; + } + + & > span:not([data-react-toolbox='tooltip']) { + display: inline-block; + line-height: var(--button-height); + vertical-align: top; + } + + & > svg { + display: inline-block; + fill: currentColor; + font-size: 120%; + height: var(--button-height); + vertical-align: top; + width: 1em; + } + + & > * { + pointer-events: none; + } + + & > .rippleWrapper { + overflow: hidden; + } + + &[disabled] { + color: var(--button-disabled-text-color); + cursor: auto; + pointer-events: none; + } +} + +.squared { + border-radius: var(--button-border-radius); + min-width: var(--button-squared-min-width); + padding: var(--button-squared-padding); + + & .icon { + font-size: 120%; + margin-right: var(--button-squared-icon-margin); + vertical-align: middle; + } + + & > svg { + margin-right: calc(0.5 * var(--unit)); + } +} + +.solid { + &[disabled] { + background-color: var(--button-disabled-background-color); + box-shadow: var(--shadow-2p); + } + + &:active { + box-shadow: var(--shadow-2p); + } + + &:focus:not(:active) { + box-shadow: + 0 0 8px rgba(0, 0, 0, 0.18), + 0 8px 16px rgba(0, 0, 0, 0.36); + } +} + +.raised { + box-shadow: var(--shadow-2p); + composes: button; + composes: squared; + composes: solid; +} + +.flat { + background: transparent; + composes: button; + composes: squared; +} + +.floating { + border-radius: 50%; + box-shadow: + 0 1px 1.5px 0 rgba(0, 0, 0, 0.12), + 0 1px 1px 0 rgba(0, 0, 0, 0.24); + composes: button; + composes: solid; + font-size: var(--button-floating-font-size); + height: var(--button-floating-height); + width: var(--button-floating-height); + + & .icon { + line-height: var(--button-floating-height); + } + + & > .rippleWrapper { + border-radius: 50%; + } + + &.mini { + font-size: var(--button-floating-mini-font-size); + height: var(--button-floating-mini-height); + width: var(--button-floating-mini-height); + + & .icon { + line-height: var(--button-floating-mini-height); + } + } +} + +.toggle { + background: transparent; + border-radius: 50%; + composes: button; + vertical-align: middle; + width: var(--button-height); + + & > .icon, + & svg { + font-size: var(--button-toggle-font-size); + line-height: var(--button-height); + vertical-align: top; + } + + & > .rippleWrapper { + border-radius: 50%; + } +} + +.primary:not([disabled]) { + &.raised, + &.floating { + background: var(--button-primary-color); + color: var(--button-primary-color-contrast); + } + + &.flat, + &.toggle { + color: var(--button-primary-color); + + &:focus:not(:active) { + background: var(--button-primary-color-hover); + } + } + + &.flat:hover { + background: var(--button-primary-color-hover); + } +} + +.accent:not([disabled]) { + &.raised, + &.floating { + background: var(--button-accent-color); + color: var(--button-accent-color-contrast); + } + + &.flat, + &.toggle { + color: var(--button-accent-color); + + &:focus:not(:active) { + background: var(--button-accent-color-hover); + } + } + + &.flat:hover { + background: var(--button-accent-color-hover); + } +} + +.neutral:not([disabled]) { + &.raised, + &.floating { + background-color: var(--button-neutral-color); + color: var(--button-neutral-color-contrast); + } + + &.flat, + &.toggle { + color: var(--button-neutral-color-contrast); + + &:focus:not(:active) { + background: var(--button-neutral-color-hover); + } + } + + &.flat:hover { + background: var(--button-neutral-color-hover); + } + + &.inverse { + &.raised, + &.floating { + background-color: var(--button-neutral-color-contrast); + color: var(--button-neutral-color); + } + + &.flat, + &.toggle { + color: var(--button-neutral-color); + + &:focus:not(:active) { + background: var(--button-neutral-color-hover); + } + } + + &.flat:hover { + background: var(--button-neutral-color-hover); + } + } +} + +.neutral.inverse[disabled] { + background-color: var(--button-disabled-background-inverse); + color: var(--button-disabled-text-color-inverse); +} diff --git a/components/button/theme.scss b/components/button/theme.scss deleted file mode 100644 index 9c450ef8..00000000 --- a/components/button/theme.scss +++ /dev/null @@ -1,187 +0,0 @@ -@import "../colors"; -@import "../globals"; -@import "../mixins"; -@import "./config"; -@import "./mixins"; - -.button { - position: relative; - - > input { - position: absolute; - top: 0; - left: 0; - z-index: 0; - width: 0.1px; - height: 0.1px; - padding: 0; - margin: 0; - overflow: hidden; - opacity: 0; - } -} - -%button { - @include typo-button(); - position: relative; - display: inline-block; - height: $button-height; - flex-direction: row; - align-content: center; - align-items: center; - justify-content: center; - line-height: $button-height; - text-align: center; - text-decoration: none; - white-space: nowrap; - cursor: pointer; - border: 0; - outline: none; - transition: box-shadow .2s $animation-curve-fast-out-linear-in, background-color .2s $animation-curve-default, color .2s $animation-curve-default; - &::-moz-focus-inner { - border: 0; - } - > span:not([data-react-toolbox="tooltip"]) { - display: inline-block; - line-height: $button-height; - vertical-align: top; - } - > svg { - display: inline-block; - width: 1em; - height: $button-height; - font-size: 120%; - vertical-align: top; - fill: currentColor; - } - > * { - pointer-events: none; - } - > .rippleWrapper { - overflow: hidden; - } - &[disabled] { - color: $button-disabled-text-color; - pointer-events: none; - cursor: auto; - } -} - -%squared { - min-width: $button-squared-min-width; - padding: $button-squared-padding; - border-radius: $button-border-radius; - .icon { - margin-right: $button-squared-icon-margin; - font-size: 120%; - vertical-align: middle; - } - > svg { - margin-right: .5 * $unit; - } -} - -%solid { - &[disabled] { - @include shadow-2dp(); - background-color: $button-disabled-background-color; - } - &:active { - @include shadow-4dp(); - } - &:focus:not(:active) { - @include focus-shadow(); - } -} - -.raised { - @extend %button; - @extend %squared; - @extend %solid; - @include shadow-2dp(); -} - -.flat { - @extend %button; - @extend %squared; - background: transparent; -} - -.floating { - @extend %button; - @extend %solid; - width: $button-floating-height; - height: $button-floating-height; - font-size: $button-floating-font-size; - border-radius: 50%; - box-shadow: 0 1px 1.5px 0 rgba(0, 0, 0, .12), 0 1px 1px 0 rgba(0, 0, 0, .24); - .icon { - line-height: $button-floating-height; - } - > .rippleWrapper { - border-radius: 50%; - } - &.mini { - width: $button-floating-mini-height; - height: $button-floating-mini-height; - font-size: $button-floating-mini-font-size; - .icon { - line-height: $button-floating-mini-height; - } - } -} - -.toggle { - @extend %button; - width: $button-height; - background: transparent; - border-radius: 50%; - > .icon, svg { - font-size: $button-toggle-font-size; - line-height: $button-height; - vertical-align: top; - } - > .rippleWrapper { - border-radius: 50%; - } -} - -.neutral:not([disabled]) { - &.raised, &.floating { - color: $button-neutral-color-contrast; - background-color: $button-neutral-color; - } - &.flat, &.toggle { - color: $button-neutral-color-contrast; - &:focus:not(:active) { - background: $button-neutral-color-hover; - } - } - &.flat:hover { - background: $button-neutral-color-hover; - } - - &.inverse { - &.raised, &.floating { - color: $button-neutral-color; - background-color: $button-neutral-color-contrast; - } - &.flat, &.toggle { - color: $button-neutral-color; - &:focus:not(:active) { - background: $button-neutral-color-hover; - } - } - &.flat:hover { - background: $button-neutral-color-hover; - } - } -} - -.neutral.inverse[disabled] { - color: $button-disabled-text-color-inverse; - background-color: $button-disabled-background-inverse; -} - -@include btn-colors("primary", $button-primary-color-contrast, $button-primary-color, $button-primary-color-hover); -@include btn-colors("accent", $button-accent-color-contrast, $button-accent-color, $button-accent-color-hover); diff --git a/components/card/_config.scss b/components/card/_config.scss deleted file mode 100644 index c89b3cb5..00000000 --- a/components/card/_config.scss +++ /dev/null @@ -1,7 +0,0 @@ -$card-color-white: $color-white !default; -$card-text-overlay: rgba($color-black, 0.35) !default; -$card-background-color: $card-color-white !default; -$card-padding-sm: .8 * $unit !default; -$card-padding: 1.6 * $unit !default; -$card-padding-lg: 2 * $unit !default; -$card-font-size: $font-size-small !default; diff --git a/components/card/config.css b/components/card/config.css new file mode 100644 index 00000000..34715f54 --- /dev/null +++ b/components/card/config.css @@ -0,0 +1,9 @@ +:root { + --card-color-white: var(--color-white); + --card-text-overlay: color(var(--color-black) a(35%)); + --card-background-color: var(--card-color-white); + --card-padding-sm: calc(0.8 * var(--unit)); + --card-padding: calc(1.6 * var(--unit)); + --card-padding-lg: calc(2 * var(--unit)); + --card-font-size: var(--font-size-small); +} diff --git a/components/card/index.js b/components/card/index.js index ef571e9b..a4e6f14a 100644 --- a/components/card/index.js +++ b/components/card/index.js @@ -6,7 +6,7 @@ import { CardMedia } from './CardMedia.js'; import { CardText } from './CardText.js'; import { cardTitleFactory } from './CardTitle.js'; import Avatar from '../avatar'; -import theme from './theme.scss'; +import theme from './theme.css'; const CardTitle = cardTitleFactory(Avatar); const ThemedCard = themr(CARD, theme)(Card); diff --git a/components/card/theme.css b/components/card/theme.css new file mode 100644 index 00000000..d827ae3e --- /dev/null +++ b/components/card/theme.css @@ -0,0 +1,182 @@ +@import '../colors.css'; +@import '../variables.css'; +@import './config.css'; + +.card { + background: var(--card-background-color); + border-radius: calc(0.2 * var(--unit)); + box-shadow: var(--shadow-2p); + composes: reset from '../helpers.css'; + display: flex; + flex-direction: column; + font-size: var(--card-font-size); + overflow: hidden; + width: 100%; + + &.raised { + box-shadow: var(--shadow-8p); + } + + & [data-react-toolbox='avatar'] { + display: block; + } +} + +.cardMedia { + background-position: center center; + background-repeat: no-repeat; + background-size: cover; + position: relative; + + &.wide, + &.square { + width: 100%; + + & .content { + height: 100%; + position: absolute; + } + + & .content > iframe, + & .content > video, + & .content > img { + max-width: 100%; + } + } + + &::after { + content: ''; + display: block; + height: 0; + } + + &.wide::after { + padding-top: 56.25%; + } + + &.square::after { + padding-top: 100%; + } + + & .content { + display: flex; + flex-direction: column; + justify-content: flex-end; + left: 0; + overflow: hidden; + position: relative; + top: 0; + width: 100%; + } + + & .contentOverlay { + & .cardTitle, + & .cardActions, + & .cardText { + background-color: var(--card-text-overlay); + } + } + + & .cardTitle { + & .title, + & .subtitle { + color: var(--card-color-white); + } + } +} + +.cardTitle { + align-items: center; + display: flex; + + & [data-react-toolbox='avatar'] { + margin-right: calc(1.3 * var(--unit)); + } + + & .title { + font-size: calc(2 * var(--unit)); + font-weight: 500; + letter-spacing: 0.02em; + line-height: 1; + margin: 0; + padding: 0; + } + + & .subtitle { + color: var(--color-text-secondary); + font-size: calc(1.4 * var(--unit)); + font-weight: 400; + letter-spacing: 0; + line-height: calc(2.4 * var(--unit)); + margin: 0; + padding: 0; + } + + &.large { + padding: var(--card-padding-lg) var(--card-padding) calc(var(--card-padding) - 0.2 * var(--unit)); + + & .title { + font-size: calc(2.4 * var(--unit)); + -moz-osx-font-smoothing: grayscale; + font-weight: 400; + line-height: 1.25; + } + } + + &.small { + padding: var(--card-padding); + + & .title { + font-size: 1.4rem; + letter-spacing: 0; + line-height: 1.4; + } + + & .subtitle { + font-weight: 500; + line-height: 1.4; + } + } +} + +.cardTitle, +.cardText { + padding: calc(var(--card-padding) - 0.2 * var(--unit)) var(--card-padding); + + & p { + font-size: calc(1.4 * var(--unit)); + font-weight: 400; + letter-spacing: 0; + line-height: calc(2.4 * var(--unit)); + margin: 0; + } + + &:last-child { + padding-bottom: var(--card-padding-lg); + } + + & + .cardText { + padding-top: 0; + } +} + +.cardActions { + align-items: center; + display: flex; + justify-content: flex-start; + padding: var(--card-padding-sm); + + & [data-react-toolbox='button'] { + margin: 0 calc(var(--card-padding-sm) / 2); + min-width: 0; + padding: 0 var(--card-padding-sm); + + &:first-child { + margin-left: 0; + } + + &:last-child { + margin-right: 0; + } + } +} diff --git a/components/card/theme.scss b/components/card/theme.scss deleted file mode 100644 index c49ea5cf..00000000 --- a/components/card/theme.scss +++ /dev/null @@ -1,126 +0,0 @@ -@import "../colors"; -@import "../globals"; -@import "../mixins"; -@import "./config"; - -.card { - @include shadow-2dp(); - display: flex; - width: 100%; - flex-direction: column; - overflow: hidden; - font-size: $card-font-size; - background: $card-background-color; - border-radius: .2 * $unit; - &.raised { - @include shadow-8dp(); - } - [data-react-toolbox="avatar"] { - display: block; - } -} - -.cardMedia { - position: relative; - background-repeat: no-repeat; - background-position: center center; - background-size: cover; - &.wide, &.square { - width: 100%; - .content { - position: absolute; - height: 100%; - } - .content > iframe, .content > video, .content > img { - max-width: 100%; - } - } - &::after { - display: block; - height: 0; - content: ""; - } - &.wide::after { - padding-top: 56.25%; - } - &.square::after { - padding-top: 100%; - } - .content { - position: relative; - top: 0; - left: 0; - display: flex; - width: 100%; - flex-direction: column; - justify-content: flex-end; - overflow: hidden; - } - .contentOverlay { - .cardTitle, .cardActions, .cardText { - background-color: $card-text-overlay; - } - } -} - -.cardTitle { - display: flex; - align-items: center; - [data-react-toolbox="avatar"] { - margin-right: 1.3 * $unit; - } - .subtitle { - color: $color-text-secondary; - } - &.large { - padding: $card-padding-lg $card-padding ($card-padding - .2 * $unit); - .title { - @include typo-headline(); - line-height: 1.25; - } - } - &.small { - padding: $card-padding; - .title { - @include typo-body-2(false, true); - line-height: 1.4; - } - .subtitle { - font-weight: 500; - line-height: 1.4; - } - } - .cardMedia & { - .title, .subtitle { - color: $card-color-white; - } - } -} - -.cardTitle, .cardText { - padding: ($card-padding - .2 * $unit) $card-padding; - &:last-child { - padding-bottom: $card-padding-lg; - } - + .cardText { - padding-top: 0; - } -} - -.cardActions { - display: flex; - align-items: center; - justify-content: flex-start; - padding: $card-padding-sm; - [data-react-toolbox="button"] { - min-width: 0; - padding: 0 $card-padding-sm; - margin: 0 $card-padding-sm / 2; - &:first-child { - margin-left: 0; - } - &:last-child { - margin-right: 0; - } - } -} diff --git a/components/checkbox/_config.scss b/components/checkbox/_config.scss deleted file mode 100644 index 18266e49..00000000 --- a/components/checkbox/_config.scss +++ /dev/null @@ -1,12 +0,0 @@ -$checkbox-color: $color-primary !default; -$checkbox-disabled-color: rgba($color-black, 0.26) !default; -$checkbox-field-margin-bottom: 1.5 * $unit !default; -$checkbox-focus-checked-color: rgba($color-primary, 0.26) !default; -$checkbox-ripple-duration: 650ms !default; -$checkbox-size: 1.8 * $unit !default; -$checkbox-focus-color: rgba($color-black, 0.1) !default; -$checkbox-focus-size: $checkbox-size * 2.3 !default; -$checkbox-text-color: $color-black !default; -$checkbox-text-font-size: $font-size-small !default; -$checkbox-total-height: 1.8 * $unit !default; -$checkbox-transition-duration: .2s !default; diff --git a/components/checkbox/config.css b/components/checkbox/config.css new file mode 100644 index 00000000..fe33d1e8 --- /dev/null +++ b/components/checkbox/config.css @@ -0,0 +1,14 @@ +:root { + --checkbox-color: var(--color-primary); + --checkbox-disabled-color: color(var(--color-black) a(26%)); + --checkbox-field-margin-bottom: calc(1.5 * var(--unit)); + --checkbox-focus-checked-color: color(var(--color-primary) a(26%)); + --checkbox-ripple-duration: 650ms; + --checkbox-size: calc(1.8 * var(--unit)); + --checkbox-focus-color: color(var(--color-black) a(1%)); + --checkbox-focus-size: calc(var(--checkbox-size) * 2.3); + --checkbox-text-color: var(--color-black); + --checkbox-text-font-size: var(--font-size-small); + --checkbox-total-height: calc(1.8 * var(--unit)); + --checkbox-transition-duration: 0.2s; +} diff --git a/components/checkbox/index.js b/components/checkbox/index.js index 5f89939a..8475ead2 100644 --- a/components/checkbox/index.js +++ b/components/checkbox/index.js @@ -3,7 +3,7 @@ import { CHECKBOX } from '../identifiers.js'; import themedRippleFactory from '../ripple'; import { checkboxFactory } from './Checkbox.js'; import checkFactory from './Check.js'; -import theme from './theme.scss'; +import theme from './theme.css'; const ThemedCheck = checkFactory(themedRippleFactory({ centered: true, spread: 2.6})); const ThemedCheckbox = themr(CHECKBOX, theme)(checkboxFactory(ThemedCheck)); diff --git a/components/checkbox/theme.css b/components/checkbox/theme.css new file mode 100644 index 00000000..d6ccfb52 --- /dev/null +++ b/components/checkbox/theme.css @@ -0,0 +1,128 @@ +@import '../colors.css'; +@import '../variables.css'; +@import './config.css'; + +.field { + composes: reset from '../helpers.css'; + display: block; + height: var(--checkbox-size); + margin-bottom: var(--checkbox-field-margin-bottom); + position: relative; + white-space: nowrap; + + & .ripple { + background-color: var(--checkbox-color); + opacity: 0.3; + transition-duration: var(--checkbox-ripple-duration); + } +} + +.text { + color: var(--checkbox-text-color); + display: inline-block; + font-size: var(--checkbox-text-font-size); + line-height: var(--checkbox-size); + padding-left: var(--unit); + vertical-align: top; + white-space: nowrap; +} + +.input { + height: 0; + opacity: 0; + overflow: hidden; + position: absolute; + width: 0; + + &:focus ~ .check { + &::before { + background-color: var(--checkbox-focus-color); + border-radius: 50%; + content: ''; + height: var(--checkbox-focus-size); + left: 50%; + margin-left: calc(-1 * var(--checkbox-focus-size) / 2); + margin-top: calc(-1 * var(--checkbox-focus-size) / 2); + pointer-events: none; + position: absolute; + top: 50%; + width: var(--checkbox-focus-size); + } + + &.checked::before { + background-color: var(--checkbox-focus-checked-color); + } + } +} + +.check { + border-color: var(--checkbox-text-color); + border-radius: 2px; + border-style: solid; + border-width: 2px; + composes: reset from '../helpers.css'; + cursor: pointer; + display: inline-block; + height: var(--checkbox-size); + position: relative; + transition-duration: var(--checkbox-transition-duration); + transition-property: background-color; + transition-timing-function: var(--animation-curve-default); + vertical-align: top; + width: var(--checkbox-size); + + &.checked { + background-color: var(--checkbox-color); + border-color: var(--checkbox-color); + + &::after { + animation: checkmark-expand 140ms ease-out forwards; + border-bottom-width: 2px; + border-color: var(--color-background); + border-left: 0; + border-right-width: 2px; + border-style: solid; + border-top: 0; + content: ''; + height: calc(1.2 * var(--unit)); + left: calc(0.4 * var(--unit)); + position: absolute; + top: calc(-0.1 * var(--unit)); + transform: rotate(45deg); + width: calc(0.7 * var(--unit)); + } + } +} + +.disabled { + & > .text { + color: var(--checkbox-disabled-color); + } + + & > .check { + border-color: var(--checkbox-disabled-color); + cursor: auto; + + &.checked { + background-color: var(--checkbox-disabled-color); + border-color: transparent; + cursor: auto; + } + } +} + +@keyframes checkmark-expand { + 0% { + height: 0; + left: calc(0.6 * var(--unit)); + top: calc(0.9 * var(--unit)); + width: 0; + } + + 100% { + height: calc(1.2 * var(--unit)); + left: calc(0.4 * var(--unit)); + top: calc(-0.1 * var(--unit)); + width: calc(0.7 * var(--unit)); + } +} diff --git a/components/checkbox/theme.scss b/components/checkbox/theme.scss deleted file mode 100644 index 55b17920..00000000 --- a/components/checkbox/theme.scss +++ /dev/null @@ -1,121 +0,0 @@ -@import "../colors"; -@import "../globals"; -@import "../mixins"; -@import "./config"; - -.field { - position: relative; - display: block; - height: $checkbox-size; - margin-bottom: $checkbox-field-margin-bottom; - white-space: nowrap; - vertical-align: middle; - .ripple { - background-color: $checkbox-color; - opacity: .3; - transition-duration: $checkbox-ripple-duration; - } -} - -.text { - display: inline-block; - padding-left: $unit; - font-size: $checkbox-text-font-size; - line-height: $checkbox-size; - color: $checkbox-text-color; - white-space: nowrap; - vertical-align: top; -} - -.input { - position: absolute; - width: 0; - height: 0; - overflow: hidden; - opacity: 0; - &:focus ~ .check { - &:before { - position: absolute; - top: 50%; - left: 50%; - width: $checkbox-focus-size; - height: $checkbox-focus-size; - margin-top: - $checkbox-focus-size / 2; - margin-left: - $checkbox-focus-size / 2; - pointer-events: none; - content: ""; - background-color: $checkbox-focus-color; - border-radius: 50%; - } - &.checked:before { - background-color: $checkbox-focus-checked-color; - } - } -} - -.check { - position: relative; - display: inline-block; - width: $checkbox-size; - height: $checkbox-size; - vertical-align: top; - cursor: pointer; - border-color: $checkbox-text-color; - border-style: solid; - border-width: 2px; - border-radius: 2px; - transition-timing-function: $animation-curve-default; - transition-duration: $checkbox-transition-duration; - transition-property: background-color; - &.checked { - background-color: $checkbox-color; - border-color: $checkbox-color; - &:after { - position: absolute; - top: -.1 * $unit; - left: .4 * $unit; - width: .7 * $unit; - height: 1.2 * $unit; - content: ""; - border-color: $color-background; - border-style: solid; - border-top: 0; - border-right-width: 2px; - border-bottom-width: 2px; - border-left: 0; - transform: rotate(45deg); - animation: checkmark-expand 140ms ease-out forwards; - } - } -} - -.disabled { - > .text { - color: $checkbox-disabled-color; - } - > .check { - cursor: auto; - border-color: $checkbox-disabled-color; - &.checked { - cursor: auto; - background-color: $checkbox-disabled-color; - border-color: transparent; - } - } -} - -@keyframes checkmark-expand { - 0% { - top: .9 * $unit; - left: .6 * $unit; - width: 0; - height: 0; - } - - 100% { - top: -.1 * $unit; - left: .4 * $unit; - width: .7 * $unit; - height: 1.2 * $unit; - } -} diff --git a/components/chip/_config.scss b/components/chip/_config.scss deleted file mode 100644 index a335b2f6..00000000 --- a/components/chip/_config.scss +++ /dev/null @@ -1,17 +0,0 @@ -$chip-height: 3.2 * $unit !default; -$chip-padding: 1.2 * $unit !default; -$chip-margin-right: 0.25 * $unit !default; -$chip-background: $palette-grey-200 !default; - -$chip-icon-font-size: 2 * $unit !default; -$chip-icon-margin-right: 0.8 * $unit !default; - -$chip-color: $color-text-secondary !default; -$chip-font-size: $font-size-small !default; - -$chip-remove-size: 2.4 * $unit !default; -$chip-remove-margin: 0.4 * $unit !default; -$chip-remove-stroke-width: 0.4 * $unit !default; -$chip-remove-background: $palette-grey-400 !default; -$chip-remove-background-hover: $palette-grey-500 !default; -$chip-remove-color: $color-white !default; diff --git a/components/chip/config.css b/components/chip/config.css new file mode 100644 index 00000000..f44c8ad2 --- /dev/null +++ b/components/chip/config.css @@ -0,0 +1,16 @@ +:root { + --chip-height: calc(3.2 * var(--unit)); + --chip-padding: calc(1.2 * var(--unit)); + --chip-margin-right: calc(0.25 * var(--unit)); + --chip-background: var(--palette-grey-200); + --chip-icon-font-size: calc(2 * var(--unit)); + --chip-icon-margin-right: calc(0.8 * var(--unit)); + --chip-color: var(--color-text-secondary); + --chip-font-size: var(--font-size-small); + --chip-remove-size: calc(2.4 * var(--unit)); + --chip-remove-margin: calc(0.4 * var(--unit)); + --chip-remove-stroke-width: calc(0.4 * var(--unit)); + --chip-remove-background: var(--palette-grey-400); + --chip-remove-background-hover: var(--palette-grey-500); + --chip-remove-color: var(--color-white); +} diff --git a/components/chip/index.js b/components/chip/index.js index 62dd4d6d..b6802a9f 100644 --- a/components/chip/index.js +++ b/components/chip/index.js @@ -2,7 +2,7 @@ import { CHIP } from '../identifiers.js'; import { themr } from 'react-css-themr'; import { chipFactory } from './Chip.js'; import Avatar from '../avatar'; -import theme from './theme.scss'; +import theme from './theme.css'; const Chip = chipFactory(Avatar); const ThemedChip = themr(CHIP, theme)(Chip); diff --git a/components/chip/theme.css b/components/chip/theme.css new file mode 100644 index 00000000..279d6424 --- /dev/null +++ b/components/chip/theme.css @@ -0,0 +1,67 @@ +@import '../colors.css'; +@import '../variables.css'; +@import './config.css'; + +.chip { + background-color: var(--chip-background); + border-radius: var(--chip-height); + color: var(--chip-color); + composes: reset from '../helpers.css'; + display: inline-block; + font-size: var(--chip-font-size); + line-height: var(--chip-height); + margin-right: var(--chip-margin-right); + max-width: 100%; + overflow: hidden; + padding: 0 var(--chip-padding); + position: relative; + text-overflow: ellipsis; + white-space: nowrap; +} + +.avatar { + padding-left: 0; + + & > [data-react-toolbox='avatar'] { + height: var(--chip-height); + margin-right: var(--chip-icon-margin-right); + vertical-align: middle; + width: var(--chip-height); + + & > span { + font-size: var(--chip-icon-font-size); + line-height: var(--chip-height); + } + } +} + +.deletable { + padding-right: calc(var(--chip-remove-size) + 2 * var(--chip-remove-margin)); +} + +.delete { + cursor: pointer; + display: inline-block; + height: var(--chip-remove-size); + margin: var(--chip-remove-margin); + padding: var(--chip-remove-margin); + position: absolute; + right: 0; + width: var(--chip-remove-size); +} + +.delete:hover .deleteIcon { + background: var(--chip-remove-background-hover); +} + +.deleteIcon { + background: var(--chip-remove-background); + border-radius: var(--chip-remove-size); + vertical-align: top; + + & .deleteX { + fill: transparent; + stroke: var(--chip-remove-color); + stroke-width: var(--chip-remove-stroke-width); + } +} diff --git a/components/chip/theme.scss b/components/chip/theme.scss deleted file mode 100644 index 4baa8f9c..00000000 --- a/components/chip/theme.scss +++ /dev/null @@ -1,68 +0,0 @@ -@import "../colors"; -@import "../globals"; -@import "../mixins"; -@import "./config"; - -.chip { - position: relative; - display: inline-block; - max-width: 100%; - padding: 0 $chip-padding; - margin-right: $chip-margin-right; - overflow: hidden; - font-size: $chip-font-size; - line-height: $chip-height; - color: $chip-color; - text-overflow: ellipsis; - white-space: nowrap; - background-color: $chip-background; - border-radius: $chip-height; -} - -.avatar { - padding-left: 0; - - > [data-react-toolbox="avatar"] { - width: $chip-height; - height: $chip-height; - margin-right: $chip-icon-margin-right; - vertical-align: middle; - - > span { - font-size: $chip-icon-font-size; - line-height: $chip-height; - } - } -} - -.deletable { - padding-right: $chip-remove-size + 2 * $chip-remove-margin; -} - -.delete { - position: absolute; - right: 0; - display: inline-block; - width: $chip-remove-size; - height: $chip-remove-size; - padding: $chip-remove-margin; - margin: $chip-remove-margin; - vertical-align: middle; - cursor: pointer; -} - -.delete:hover .deleteIcon { - background: $chip-remove-background-hover; -} - -.deleteIcon { - vertical-align: top; - background: $chip-remove-background; - border-radius: $chip-remove-size; - - .deleteX { - fill: transparent; - stroke-width: $chip-remove-stroke-width; - stroke: $chip-remove-color; - } -} diff --git a/components/colors.css b/components/colors.css new file mode 100644 index 00000000..b72f5a9f --- /dev/null +++ b/components/colors.css @@ -0,0 +1,279 @@ +:root { + --palette-red-50: rgb(255, 235, 238); + --palette-red-100: rgb(255, 205, 210); + --palette-red-200: rgb(239, 154, 154); + --palette-red-300: rgb(229, 115, 115); + --palette-red-400: rgb(239, 83, 80); + --palette-red-500: rgb(244, 67, 54); + --palette-red-600: rgb(229, 57, 53); + --palette-red-700: rgb(211, 47, 47); + --palette-red-800: rgb(198, 40, 40); + --palette-red-900: rgb(183, 28, 28); + --palette-red-a100: rgb(255, 138, 128); + --palette-red-a200: rgb(255, 82, 82); + --palette-red-a400: rgb(255, 23, 68); + --palette-red-a700: rgb(213, 0, 0); + + --palette-pink-50: rgb(252, 228, 236); + --palette-pink-100: rgb(248, 187, 208); + --palette-pink-200: rgb(244, 143, 177); + --palette-pink-300: rgb(240, 98, 146); + --palette-pink-400: rgb(236, 64, 122); + --palette-pink-500: rgb(233, 30, 99); + --palette-pink-600: rgb(216, 27, 96); + --palette-pink-700: rgb(194, 24, 91); + --palette-pink-800: rgb(173, 20, 87); + --palette-pink-900: rgb(136, 14, 79); + --palette-pink-a100: rgb(255, 128, 171); + --palette-pink-a200: rgb(255, 64, 129); + --palette-pink-a400: rgb(245, 0, 87); + --palette-pink-a700: rgb(197, 17, 98); + + --palette-purple-50: rgb(243, 229, 245); + --palette-purple-100: rgb(225, 190, 231); + --palette-purple-200: rgb(206, 147, 216); + --palette-purple-300: rgb(186, 104, 200); + --palette-purple-400: rgb(171, 71, 188); + --palette-purple-500: rgb(156, 39, 176); + --palette-purple-600: rgb(142, 36, 170); + --palette-purple-700: rgb(123, 31, 162); + --palette-purple-800: rgb(106, 27, 154); + --palette-purple-900: rgb(74, 20, 140); + --palette-purple-a100: rgb(234, 128, 252); + --palette-purple-a200: rgb(224, 64, 251); + --palette-purple-a400: rgb(213, 0, 249); + --palette-purple-a700: rgb(170, 0, 255); + + --palette-deep-purple-50: rgb(237, 231, 246); + --palette-deep-purple-100: rgb(209, 196, 233); + --palette-deep-purple-200: rgb(179, 157, 219); + --palette-deep-purple-300: rgb(149, 117, 205); + --palette-deep-purple-400: rgb(126, 87, 194); + --palette-deep-purple-500: rgb(103, 58, 183); + --palette-deep-purple-600: rgb(94, 53, 177); + --palette-deep-purple-700: rgb(81, 45, 168); + --palette-deep-purple-800: rgb(69, 39, 160); + --palette-deep-purple-900: rgb(49, 27, 146); + --palette-deep-purple-a100: rgb(179, 136, 255); + --palette-deep-purple-a200: rgb(124, 77, 255); + --palette-deep-purple-a400: rgb(101, 31, 255); + --palette-deep-purple-a700: rgb(98, 0, 234); + + --palette-indigo-50: rgb(232, 234, 246); + --palette-indigo-100: rgb(197, 202, 233); + --palette-indigo-200: rgb(159, 168, 218); + --palette-indigo-300: rgb(121, 134, 203); + --palette-indigo-400: rgb(92, 107, 192); + --palette-indigo-500: rgb(63, 81, 181); + --palette-indigo-600: rgb(57, 73, 171); + --palette-indigo-700: rgb(48, 63, 159); + --palette-indigo-800: rgb(40, 53, 147); + --palette-indigo-900: rgb(26, 35, 126); + --palette-indigo-a100: rgb(140, 158, 255); + --palette-indigo-a200: rgb(83, 109, 254); + --palette-indigo-a400: rgb(61, 90, 254); + --palette-indigo-a700: rgb(48, 79, 254); + + --palette-blue-50: rgb(227, 242, 253); + --palette-blue-100: rgb(187, 222, 251); + --palette-blue-200: rgb(144, 202, 249); + --palette-blue-300: rgb(100, 181, 246); + --palette-blue-400: rgb(66, 165, 245); + --palette-blue-500: rgb(33, 150, 243); + --palette-blue-600: rgb(30, 136, 229); + --palette-blue-700: rgb(25, 118, 210); + --palette-blue-800: rgb(21, 101, 192); + --palette-blue-900: rgb(13, 71, 161); + --palette-blue-a100: rgb(130, 177, 255); + --palette-blue-a200: rgb(68, 138, 255); + --palette-blue-a400: rgb(41, 121, 255); + --palette-blue-a700: rgb(41, 98, 255); + + --palette-light-blue-50: rgb(225, 245, 254); + --palette-light-blue-100: rgb(179, 229, 252); + --palette-light-blue-200: rgb(129, 212, 250); + --palette-light-blue-300: rgb(79, 195, 247); + --palette-light-blue-400: rgb(41, 182, 246); + --palette-light-blue-500: rgb(3, 169, 244); + --palette-light-blue-600: rgb(3, 155, 229); + --palette-light-blue-700: rgb(2, 136, 209); + --palette-light-blue-800: rgb(2, 119, 189); + --palette-light-blue-900: rgb(1, 87, 155); + --palette-light-blue-a100: rgb(128, 216, 255); + --palette-light-blue-a200: rgb(64, 196, 255); + --palette-light-blue-a400: rgb(0, 176, 255); + --palette-light-blue-a700: rgb(0, 145, 234); + + --palette-cyan-50: rgb(224, 247, 250); + --palette-cyan-100: rgb(178, 235, 242); + --palette-cyan-200: rgb(128, 222, 234); + --palette-cyan-300: rgb(77, 208, 225); + --palette-cyan-400: rgb(38, 198, 218); + --palette-cyan-500: rgb(0, 188, 212); + --palette-cyan-600: rgb(0, 172, 193); + --palette-cyan-700: rgb(0, 151, 167); + --palette-cyan-800: rgb(0, 131, 143); + --palette-cyan-900: rgb(0, 96, 100); + --palette-cyan-a100: rgb(132, 255, 255); + --palette-cyan-a200: rgb(24, 255, 255); + --palette-cyan-a400: rgb(0, 229, 255); + --palette-cyan-a700: rgb(0, 184, 212); + + --palette-teal-50: rgb(224, 242, 241); + --palette-teal-100: rgb(178, 223, 219); + --palette-teal-200: rgb(128, 203, 196); + --palette-teal-300: rgb(77, 182, 172); + --palette-teal-400: rgb(38, 166, 154); + --palette-teal-500: rgb(0, 150, 136); + --palette-teal-600: rgb(0, 137, 123); + --palette-teal-700: rgb(0, 121, 107); + --palette-teal-800: rgb(0, 105, 92); + --palette-teal-900: rgb(0, 77, 64); + --palette-teal-a100: rgb(167, 255, 235); + --palette-teal-a200: rgb(100, 255, 218); + --palette-teal-a400: rgb(29, 233, 182); + --palette-teal-a700: rgb(0, 191, 165); + + --palette-green-50: rgb(232, 245, 233); + --palette-green-100: rgb(200, 230, 201); + --palette-green-200: rgb(165, 214, 167); + --palette-green-300: rgb(129, 199, 132); + --palette-green-400: rgb(102, 187, 106); + --palette-green-500: rgb(76, 175, 80); + --palette-green-600: rgb(67, 160, 71); + --palette-green-700: rgb(56, 142, 60); + --palette-green-800: rgb(46, 125, 50); + --palette-green-900: rgb(27, 94, 32); + --palette-green-a100: rgb(185, 246, 202); + --palette-green-a200: rgb(105, 240, 174); + --palette-green-a400: rgb(0, 230, 118); + --palette-green-a700: rgb(0, 200, 83); + + --palette-light-green-50: rgb(241, 248, 233); + --palette-light-green-100: rgb(220, 237, 200); + --palette-light-green-200: rgb(197, 225, 165); + --palette-light-green-300: rgb(174, 213, 129); + --palette-light-green-400: rgb(156, 204, 101); + --palette-light-green-500: rgb(139, 195, 74); + --palette-light-green-600: rgb(124, 179, 66); + --palette-light-green-700: rgb(104, 159, 56); + --palette-light-green-800: rgb(85, 139, 47); + --palette-light-green-900: rgb(51, 105, 30); + --palette-light-green-a100: rgb(204, 255, 144); + --palette-light-green-a200: rgb(178, 255, 89); + --palette-light-green-a400: rgb(118, 255, 3); + --palette-light-green-a700: rgb(100, 221, 23); + + --palette-lime-50: rgb(249, 251, 231); + --palette-lime-100: rgb(240, 244, 195); + --palette-lime-200: rgb(230, 238, 156); + --palette-lime-300: rgb(220, 231, 117); + --palette-lime-400: rgb(212, 225, 87); + --palette-lime-500: rgb(205, 220, 57); + --palette-lime-600: rgb(192, 202, 51); + --palette-lime-700: rgb(175, 180, 43); + --palette-lime-800: rgb(158, 157, 36); + --palette-lime-900: rgb(130, 119, 23); + --palette-lime-a100: rgb(244, 255, 129); + --palette-lime-a200: rgb(238, 255, 65); + --palette-lime-a400: rgb(198, 255, 0); + --palette-lime-a700: rgb(174, 234, 0); + + --palette-yellow-50: rgb(255, 253, 231); + --palette-yellow-100: rgb(255, 249, 196); + --palette-yellow-200: rgb(255, 245, 157); + --palette-yellow-300: rgb(255, 241, 118); + --palette-yellow-400: rgb(255, 238, 88); + --palette-yellow-500: rgb(255, 235, 59); + --palette-yellow-600: rgb(253, 216, 53); + --palette-yellow-700: rgb(251, 192, 45); + --palette-yellow-800: rgb(249, 168, 37); + --palette-yellow-900: rgb(245, 127, 23); + --palette-yellow-a100: rgb(255, 255, 141); + --palette-yellow-a200: rgb(255, 255, 0); + --palette-yellow-a400: rgb(255, 234, 0); + --palette-yellow-a700: rgb(255, 214, 0); + + --palette-amber-50: rgb(255, 248, 225); + --palette-amber-100: rgb(255, 236, 179); + --palette-amber-200: rgb(255, 224, 130); + --palette-amber-300: rgb(255, 213, 79); + --palette-amber-400: rgb(255, 202, 40); + --palette-amber-500: rgb(255, 193, 7); + --palette-amber-600: rgb(255, 179, 0); + --palette-amber-700: rgb(255, 160, 0); + --palette-amber-800: rgb(255, 143, 0); + --palette-amber-900: rgb(255, 111, 0); + --palette-amber-a100: rgb(255, 229, 127); + --palette-amber-a200: rgb(255, 215, 64); + --palette-amber-a400: rgb(255, 196, 0); + --palette-amber-a700: rgb(255, 171, 0); + + --palette-orange-50: rgb(255, 243, 224); + --palette-orange-100: rgb(255, 224, 178); + --palette-orange-200: rgb(255, 204, 128); + --palette-orange-300: rgb(255, 183, 77); + --palette-orange-400: rgb(255, 167, 38); + --palette-orange-500: rgb(255, 152, 0); + --palette-orange-600: rgb(251, 140, 0); + --palette-orange-700: rgb(245, 124, 0); + --palette-orange-800: rgb(239, 108, 0); + --palette-orange-900: rgb(230, 81, 0); + --palette-orange-a100: rgb(255, 209, 128); + --palette-orange-a200: rgb(255, 171, 64); + --palette-orange-a400: rgb(255, 145, 0); + --palette-orange-a700: rgb(255, 109, 0); + + --palette-deep-orange-50: rgb(251, 233, 231); + --palette-deep-orange-100: rgb(255, 204, 188); + --palette-deep-orange-200: rgb(255, 171, 145); + --palette-deep-orange-300: rgb(255, 138, 101); + --palette-deep-orange-400: rgb(255, 112, 67); + --palette-deep-orange-500: rgb(255, 87, 34); + --palette-deep-orange-600: rgb(244, 81, 30); + --palette-deep-orange-700: rgb(230, 74, 25); + --palette-deep-orange-800: rgb(216, 67, 21); + --palette-deep-orange-900: rgb(191, 54, 12); + --palette-deep-orange-a100: rgb(255, 158, 128); + --palette-deep-orange-a200: rgb(255, 110, 64); + --palette-deep-orange-a400: rgb(255, 61, 0); + --palette-deep-orange-a700: rgb(221, 44, 0); + + --palette-brown-50: rgb(239, 235, 233); + --palette-brown-100: rgb(215, 204, 200); + --palette-brown-200: rgb(188, 170, 164); + --palette-brown-300: rgb(161, 136, 127); + --palette-brown-400: rgb(141, 110, 99); + --palette-brown-500: rgb(121, 85, 72); + --palette-brown-600: rgb(109, 76, 65); + --palette-brown-700: rgb(93, 64, 55); + --palette-brown-800: rgb(78, 52, 46); + --palette-brown-900: rgb(62, 39, 35); + + --palette-grey-50: rgb(250, 250, 250); + --palette-grey-100: rgb(245, 245, 245); + --palette-grey-200: rgb(238, 238, 238); + --palette-grey-300: rgb(224, 224, 224); + --palette-grey-400: rgb(189, 189, 189); + --palette-grey-500: rgb(158, 158, 158); + --palette-grey-600: rgb(117, 117, 117); + --palette-grey-700: rgb(97, 97, 97); + --palette-grey-800: rgb(66, 66, 66); + --palette-grey-900: rgb(33, 33, 33); + + --palette-blue-grey-50: rgb(236, 239, 241); + --palette-blue-grey-100: rgb(207, 216, 220); + --palette-blue-grey-200: rgb(176, 190, 197); + --palette-blue-grey-300: rgb(144, 164, 174); + --palette-blue-grey-400: rgb(120, 144, 156); + --palette-blue-grey-500: rgb(96, 125, 139); + --palette-blue-grey-600: rgb(84, 110, 122); + --palette-blue-grey-700: rgb(69, 90, 100); + --palette-blue-grey-800: rgb(55, 71, 79); + --palette-blue-grey-900: rgb(38, 50, 56); + + --color-black: rgb(0, 0, 0); + --color-white: rgb(255, 255, 255); + --color-dark-contrast: var(--color-white); + --color-light-contrast: var(--color-black); +} diff --git a/components/commons.scss b/components/commons.scss deleted file mode 100644 index 54f9ba16..00000000 --- a/components/commons.scss +++ /dev/null @@ -1,95 +0,0 @@ -@import "./colors"; -@import "./globals"; -@import "./mixins"; -@import "~normalize.css"; - -html { - font-size: 62.5%; -} - -body { - position: absolute; - width: 100%; - height: 100%; - padding: 0; - margin: 0; - font-family: Roboto, sans-serif; - font-size: 1.6rem; - -webkit-touch-callout: none; - * { - -webkit-tap-highlight-color: rgba(255, 255, 255, 0); - } -} - -a, abbr, address, article, aside, audio, b, blockquote, body, caption, cite, -code, dd, del, dfn, dialog, div, dl, dt, em, fieldset, figure, footer, form, h1, -h2, h3, h4, h5, h6, header, hgroup, hr, html, i, iframe, img, ins, kbd, label, -legend, li, mark, menu, nav, object, ol, p, pre, q, samp, section, small, span, -strong, sub, sup, table, tbody, td, tfoot, th, thead, time, tr, ul, var, video { - padding: 0; - margin: 0; - border: 0; - outline: 0; -} - -*, *:before, *:after { - box-sizing: border-box; - padding: 0; - margin: 0; -} - -h1, h2, h3, h4, h5, h6, label, p, button, abbr, a, span, small { - font-smoothing: antialiased; - -webkit-font-smoothing: antialiased; - text-size-adjust: 100%; -} - -a { - text-decoration: none; - -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -} - -input:not([type="checkbox"]):not([type="radio"]), button { - outline: none; - appearance: none; - -webkit-touch-callout: none; - -webkit-tap-highlight-color: rgba(255, 255, 255, 0); -} - -// -- Remove firefox default style for required inputs -input[required]:-moz-ui-invalid { - box-shadow: none; -} - -// -- Material design font sizes -h1 small, h2 small, h3 small, h4 small, h5 small, h6 small { - @include typo-display-3($color-contrast: true); -} - -h1 { - @include typo-display-3; -} - -h2 { - @include typo-display-2; -} - -h3 { - @include typo-display-1; -} - -h4 { - @include typo-headline; -} - -h5 { - @include typo-title; -} - -h6 { - @include typo-subhead; -} - -p { - @include typo-body-1; -} diff --git a/components/date_picker/Calendar.js b/components/date_picker/Calendar.js index b8628fe7..cb4ff1be 100644 --- a/components/date_picker/Calendar.js +++ b/components/date_picker/Calendar.js @@ -1,8 +1,7 @@ import React, { Component, PropTypes } from 'react'; import CssTransitionGroup from 'react-addons-css-transition-group'; -import { SlideLeft, SlideRight } from '../animations'; +import { range, getAnimationModule } from '../utils/utils'; import time from '../utils/time.js'; -import utils from '../utils/utils.js'; import CalendarMonth from './CalendarMonth.js'; const DIRECTION_STEPS = { left: -1, right: 1 }; @@ -104,7 +103,7 @@ const factory = (IconButton) => { renderYears () { return ( diff --git a/docs/app/components/layout/home/style.css b/docs/app/components/layout/home/style.css new file mode 100644 index 00000000..60a292f5 --- /dev/null +++ b/docs/app/components/layout/home/style.css @@ -0,0 +1,220 @@ +@import 'colors.css'; +@import 'variables.css'; + +:root { + --hero-gradient-dark: var(--color-primary-dark); + --hero-gradient-light: var(--color-primary-light); + --hero-text-color: var(--color-primary-contrast); + --hero-max-width: calc(62 * var(--unit)); + --hero-text-secondary-opacity: 0.75; + --hero-item-spacing: calc(5 * var(--unit)); + --hero-logo-size: calc(12 * var(--unit)); + --hero-logo-opacity: 0.85; + --github-buttons-height: calc(4 * var(--unit)); + --twitter-color: #55acee; + --content-offset: calc(4.8 * var(--unit)); + --content-width: 740px; + --color-content: #fafafa; +} + +.header { + background: linear-gradient(45deg, var(--hero-gradient-dark) 0%, var(--hero-gradient-light) 100%); + background-position: top right; + background-size: 120%; + color: var(--hero-text-color); + padding: 0 calc((100% - var(--hero-max-width)) / 2); + text-align: center; + + & .logo { + fill: var(--hero-text-color); + height: var(--hero-logo-size); + margin-top: calc(var(--hero-item-spacing) + var(--github-buttons-height)); + opacity: var(--hero-logo-opacity); + width: var(--hero-logo-size); + } + + & .title { + font-size: calc(5.6 * var(--unit)); + font-weight: 400; + letter-spacing: -0.02em; + line-height: 1.35; + margin-top: var(--hero-item-spacing); + } + + & .subtitle { + font-size: calc(2.4 * var(--unit)); + font-weight: 400; + line-height: 1.2; + margin-top: var(--unit); + opacity: var(--hero-text-secondary-opacity); + } + + & .github { + left: calc(2 * var(--unit)); + position: fixed; + text-align: center; + top: calc(2 * var(--unit)); + z-index: var(--z-index-higher); + + & iframe { + display: inline-block; + height: calc(2 * var(--unit)); + vertical-align: top; + width: calc(10 * var(--unit)); + } + } + + & .navigation > ul { + list-style: none; + margin-top: var(--hero-item-spacing); + + & li { + display: inline-block; + position: relative; + + &:not(:last-child) > a::after { + content: '·'; + display: inline-block; + font-size: 50px; + line-height: 60px; + margin: 0 10px; + vertical-align: middle; + } + + & > a { + color: var(--hero-text-color); + display: inline-block; + font-size: calc(2 * var(--unit)); + font-weight: 400; + letter-spacing: 0.02em; + line-height: 60px; + opacity: var(--hero-text-secondary-opacity); + position: relative; + vertical-align: middle; + + &:hover { + opacity: 1; + } + } + } + } +} + +.twitterButton { + &.neutral.flat:not([disabled]) { + color: var(--twitter-color); + } +} + +.content { + align-items: center; + background-color: var(--color-content); + display: flex; + flex-direction: column; + flex-wrap: wrap; + padding: var(--content-offset); + + &:nth-child(3) { + background-color: color(var(--color-content) blackness(5%)); + } + + & > .authors { + align-items: flex-start; + display: flex; + justify-content: center; + + & > * { + flex: 1 auto; + margin: 0 var(--unit); + max-width: calc(32 * var(--unit)); + } + } + + & > p { + font-size: calc(1.8 * var(--unit)); + line-height: 1.5; + margin-bottom: var(--content-offset); + max-width: var(--content-width); + opacity: 0.6; + text-align: justify; + } + + & > h2 { + color: var(--hero-gradient-dark); + font-size: calc(2 * var(--unit)); + margin-bottom: var(--content-offset); + } + + & > h3 { + color: var(--color-primary-dark); + font-size: calc(2.4 * var(--unit)); + margin-bottom: calc(var(--content-offset) / 2); + } +} + +.footer { + background-color: var(--color-text); + color: var(--color-content); + padding: calc(2 * var(--unit)) 0; + text-align: center; + + & .love { + color: var(--color-accent); + font-size: var(--font-size-normal); + } + + & small { + color: rgba(255, 255, 255, 0.5); + } +} + +.donate { + border-radius: 3px; + color: #fff; + display: inline-block; + font-size: calc(1.1 * var(--unit)); + overflow: hidden; + vertical-align: top; + + & .legend { + background-color: #555; + display: inline-block; + line-height: calc(2 * var(--unit)); + padding: 0 calc(0.5 * var(--unit)); + } + + & .paypal { + background-color: #007ec6; + display: inline-block; + line-height: calc(2 * var(--unit)); + padding: 0 calc(0.5 * var(--unit)); + } +} + +@media all and (max-width: 768px) { + & .header { + & .github { + position: absolute; + } + } + + & .content { + padding: calc(var(--content-offset) / 2); + + & > .authors { + flex-direction: column; + + & > * { + margin: var(--unit) 0; + } + } + + & > p { + max-width: 100%; + } + } + + & .second-content { + background-color: transparent; + } +} diff --git a/docs/app/components/layout/home/style.scss b/docs/app/components/layout/home/style.scss deleted file mode 100644 index 7203229b..00000000 --- a/docs/app/components/layout/home/style.scss +++ /dev/null @@ -1,177 +0,0 @@ -@import "../../globals"; -@import "./config"; - -$twitter-color: #55acee; -$content-offset: 4.8 * $unit; -$content-width: 740px; - -.header { - padding: 0 calc((100% - #{$hero-max-width}) / 2); - color: $hero-text-color; - text-align: center; - background: linear-gradient(45deg, $hero-gradient-dark 0%, $hero-gradient-light 100%); - background-position: top right; - background-size: 120%; - .logo { - width: $hero-logo-size; - height: $hero-logo-size; - margin-top: $hero-item-spacing + $github-buttons-height; - opacity: $hero-logo-opacity; - fill: $hero-text-color; - } - .title { - @include typo-display-3; - margin-top: $hero-item-spacing; - } - .subtitle { - @include typo-headline; - margin-top: 10px; - font-weight: 400; - line-height: 1.2; - opacity: $hero-text-secondary-opacity; - } - .github { - position: fixed; - top: 2 * $unit; - left: 2 * $unit; - z-index: $z-index-higher; - text-align: center; - iframe { - display: inline-block; - width: 10 * $unit; - height: 2 * $unit; - vertical-align: top; - } - } - .navigation > ul { - margin-top: $hero-item-spacing; - list-style: none; - li { - position: relative; - display: inline-block; - &:not(:last-child) > a:after { - display: inline-block; - margin: 0 10px; - font-size: 50px; - line-height: 60px; - vertical-align: middle; - content: "·"; - } - > a { - @include typo-title; - position: relative; - display: inline-block; - font-weight: 400; - line-height: 60px; - color: $hero-text-color; - vertical-align: middle; - opacity: $hero-text-secondary-opacity; - &:hover { - opacity: 1; - } - } - } - } -} - -.content { - display: flex; - flex-direction: column; - flex-wrap: wrap; - align-items: center; - padding: $content-offset; - background-color: $color-content; - &:nth-child(3) { - background-color: darken($color-content, 5%); - } - > .authors { - display: flex; - align-items: flex-start; - justify-content: center; - > * { - max-width: 32 * $unit; - flex: 1 auto; - margin: 0 $unit; - } - .twitter { - color: $twitter-color !important; - } - } - > p { - max-width: $content-width; - margin-bottom: $content-offset; - font-size: 1.8 * $unit; - line-height: 1.5; - text-align: justify; - opacity: .6; - } - > h2 { - margin-bottom: $content-offset; - font-size: 2 * $unit; - color: $hero-gradient-dark; - } - > h3 { - margin-bottom: $content-offset / 2; - font-size: 2.4 * $unit; - color: $color-primary-dark; - } -} - -.footer { - padding: 2 * $unit 0; - color: $color-content; - text-align: center; - background-color: $color-text; - .love { - font-size: $font-size-normal; - color: $color-accent; - } - small { - color: rgba(255,255,255,.5); - } -} - -.donate { - display: inline-block; - overflow: hidden; - font-size: 1.1 * $unit; - color: #fff; - vertical-align: top; - border-radius: 3px; - .legend { - display: inline-block; - padding: 0 .5 * $unit; - line-height: 2 * $unit; - background-color: #555; - } - .paypal { - display: inline-block; - padding: 0 .5 * $unit; - line-height: 2 * $unit; - background-color: #007ec6; - } -} - -@media all and (max-width: 768px) { - .header { - .github { - position: absolute; - } - } - .content { - padding: $content-offset / 2; - > .authors { - flex-direction: column; - > * { - margin: $unit 0; - } - } - > p { - max-width: 100%; - } - } - - .second-content { - background-color: transparent; - } -} diff --git a/docs/app/components/layout/install/index.js b/docs/app/components/layout/install/index.js index 0d3e6c5b..5e8b9553 100644 --- a/docs/app/components/layout/install/index.js +++ b/docs/app/components/layout/install/index.js @@ -2,7 +2,7 @@ import React from 'react'; import Appbar from '../../../components/appbar'; import Markdown from '../../../components/markdown'; import installMD from './install'; -import style from './style'; +import style from './style.css'; class Install extends React.Component { render () { diff --git a/docs/app/components/layout/install/style.css b/docs/app/components/layout/install/style.css new file mode 100644 index 00000000..eb7e6cc6 --- /dev/null +++ b/docs/app/components/layout/install/style.css @@ -0,0 +1,6 @@ +@import 'variables.css'; +@import 'app_bar/config.css'; + +.install { + margin-top: var(--appbar-height); +} diff --git a/docs/app/components/layout/install/style.scss b/docs/app/components/layout/install/style.scss deleted file mode 100644 index 968a90a4..00000000 --- a/docs/app/components/layout/install/style.scss +++ /dev/null @@ -1,6 +0,0 @@ -@import "../../globals"; -@import "~react-toolbox/app_bar/config"; - -.install { - margin-top: $appbar-height; -} diff --git a/docs/app/components/layout/main/_config.scss b/docs/app/components/layout/main/_config.scss deleted file mode 100644 index d564a848..00000000 --- a/docs/app/components/layout/main/_config.scss +++ /dev/null @@ -1,11 +0,0 @@ -@import "../../globals"; - -$media-min-width: 1440px; -$playground-max-width: $media-min-width / 2; -$playground-width: 50%; -$navigation-width: 22 * $unit; -$navigation-h-padding: 2.4 * $unit; -$navigation-v-padding: 1.2 * $unit; -$navigation-footer-border: solid 1px rgb(224, 224, 224); -$documentation-left-shadow: 0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12),0 2px 4px -1px rgba(0,0,0,.2); -$documentation-right-shadow: -2px 0 4px rgba(0,0,0,.14); diff --git a/docs/app/components/layout/main/button-theme.scss b/docs/app/components/layout/main/button-theme.scss deleted file mode 100644 index a2900e34..00000000 --- a/docs/app/components/layout/main/button-theme.scss +++ /dev/null @@ -1,2 +0,0 @@ -@import "../../globals"; -@import "~react-toolbox/button/theme"; diff --git a/docs/app/components/layout/main/components/navigation.css b/docs/app/components/layout/main/components/navigation.css new file mode 100644 index 00000000..0d203027 --- /dev/null +++ b/docs/app/components/layout/main/components/navigation.css @@ -0,0 +1,48 @@ +@import 'colors.css'; +@import 'variables.css'; +@import '../config.css'; + +.root { + background-color: var(--color-background); + display: flex; + flex-direction: column; + width: var(--navigation-width); +} + +.list { + flex-grow: 1; + overflow-y: auto; + + &::-webkit-scrollbar { + height: 0; + width: 0; + } +} + +.item { + & > span { + padding: var(--navigation-v-padding) var(--navigation-h-padding); + } + + & [data-react-toolbox='list-item-text'] { + font-size: var(--font-size-small); + font-weight: var(--font-weight-semi-bold); + } +} + +.active { + background: $color-divider; +} + +.footer { + border-top: var(--navigation-footer-border); + color: var(--color-text-secondary); + flex-grow: 0; + font-size: var(--font-size-small); + overflow: hidden; + padding: var(--navigation-h-padding); + + & > * { + display: block; + } +} diff --git a/docs/app/components/layout/main/components/navigation.js b/docs/app/components/layout/main/components/navigation.js index 8d6a5a24..77efea2d 100644 --- a/docs/app/components/layout/main/components/navigation.js +++ b/docs/app/components/layout/main/components/navigation.js @@ -2,7 +2,7 @@ import React, { PropTypes } from 'react'; import { List, ListItem } from 'react-toolbox'; import classnames from 'classnames'; import components from '../modules/components'; -import style from './navigation.scss'; +import style from './navigation.css'; const MainNavigation = ({ className }, { router }) => { const drawerItems = Object.keys(components).map((key) => { diff --git a/docs/app/components/layout/main/components/navigation.scss b/docs/app/components/layout/main/components/navigation.scss deleted file mode 100644 index 37203cc2..00000000 --- a/docs/app/components/layout/main/components/navigation.scss +++ /dev/null @@ -1,40 +0,0 @@ -@import "../config"; - -.root { - display: flex; - width: $navigation-width; - flex-direction: column; - background-color: $color-background; -} - -.list { - @include no-webkit-scrollbar; - flex-grow: 1; - overflow-y: auto; -} - -.item { - > span{ - padding: $navigation-v-padding $navigation-h-padding; - } - [data-react-toolbox="list-item-text"] { - font-size: $font-size-small; - font-weight: $font-weight-semi-bold; - } -} - -.active { - background: $color-divider; -} - -.footer { - flex-grow: 0; - padding: $navigation-h-padding; - overflow: hidden; - font-size: $font-size-small; - color: $color-text-secondary; - border-top: $navigation-footer-border; - > * { - display: block; - } -} diff --git a/docs/app/components/layout/main/components/playground.scss b/docs/app/components/layout/main/components/playground.css similarity index 62% rename from docs/app/components/layout/main/components/playground.scss rename to docs/app/components/layout/main/components/playground.css index b10e7987..d059090c 100644 --- a/docs/app/components/layout/main/components/playground.scss +++ b/docs/app/components/layout/main/components/playground.css @@ -1,29 +1,37 @@ -@import "../config"; +@import 'colors.css'; +@import 'variables.css'; +@import '../config.css'; -.editor, .preview { - @include no-webkit-scrollbar; +.editor, +.preview { + overflow-y: auto; position: absolute; right: 0; - overflow-y: auto; + + &::-webkit-scrollbar { + height: 0; + width: 0; + } } .editor { - top: 0; bottom: 50%; left: 0; - div:global(.CodeMirror) { + top: 0; + + & div:global(.CodeMirror) { display: flex; - height: 100%; - min-height: 100%; - max-height: 100%; flex-direction: column; flex-grow: 1; + height: 100%; + max-height: 100%; + min-height: 100%; } } .preview { - top: 50%; bottom: 0; - left: 0; display: flex; + left: 0; + top: 50%; } diff --git a/docs/app/components/layout/main/components/playground.js b/docs/app/components/layout/main/components/playground.js index c848fec2..dc79285f 100644 --- a/docs/app/components/layout/main/components/playground.js +++ b/docs/app/components/layout/main/components/playground.js @@ -2,7 +2,7 @@ import React from 'react'; import Editor from '../../../editor'; import Preview from '../../../preview'; import codeText from '../modules/examples/example.txt'; -import style from './playground.scss'; +import style from './playground.css'; class Playground extends React.Component { static propTypes = { diff --git a/docs/app/components/layout/main/config.css b/docs/app/components/layout/main/config.css new file mode 100644 index 00000000..145f4fcb --- /dev/null +++ b/docs/app/components/layout/main/config.css @@ -0,0 +1,14 @@ +:root { + --media-min-width: 1440px; + --playground-max-width: calc(var(--media-min-width) / 2); + --playground-width: 50%; + --navigation-width: calc(22 * var(--unit)); + --navigation-h-padding: calc(2.4 * var(--unit)); + --navigation-v-padding: calc(1.2 * var(--unit)); + --navigation-footer-border: solid 1px rgb(224, 224, 224); + --documentation-left-shadow: + 0 4px 5px 0 color(var(--color-black) a(14%)), + 0 1px 10px 0 color(var(--color-black) a(12%)), + 0 2px 4px -1px color(var(--color-black) a(20%)); + --documentation-right-shadow: -2px 0 4px color(var(--color-black) a(14%)); +} diff --git a/docs/app/components/layout/main/index.js b/docs/app/components/layout/main/index.js index 7685e20f..4ada79ac 100644 --- a/docs/app/components/layout/main/index.js +++ b/docs/app/components/layout/main/index.js @@ -7,15 +7,14 @@ import Playground from './components/playground.js'; import MainNavigation from './components/navigation.js'; import BaseDocs from './modules/components.md'; import components from './modules/components.js'; -import buttonTheme from './button-theme.scss'; -import style from './style'; +import style from './style.css'; const LoadExampleButton = (props) => (