From ccbb6adc86661098faba37cbff4e390554ecc752 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Sat, 12 Aug 2017 14:22:17 +0200 Subject: [PATCH] Theme page for simple testing. --- .gitignore | 4 +- src/Squidex/app-config/webpack.run.base.js | 4 + .../services/notification.service.spec.ts | 2 +- .../services/notification.service.ts | 2 +- .../internal/internal-area.component.html | 4 +- .../internal/internal-area.component.scss | 24 +- .../pages/internal/internal-area.component.ts | 6 +- src/Squidex/app/theme/_bootstrap-vars.scss | 22 + src/Squidex/app/theme/_bootstrap.scss | 53 +- src/Squidex/app/theme/_vars.scss | 3 + src/Squidex/wwwroot/theme.html | 1207 +++++++++++++++++ 11 files changed, 1288 insertions(+), 43 deletions(-) create mode 100644 src/Squidex/wwwroot/theme.html diff --git a/.gitignore b/.gitignore index 7cce4633a..c2f3a2d05 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ *.vs *.log +.vscode + # Build results build/ bin/ @@ -21,4 +23,4 @@ node_modules/ /src/Squidex/appsettings.Development.json /src/Squidex/Assets -/src/Squidex/Properties/launchSettings.json +/src/Squidex/Properties/launchSettings.json \ No newline at end of file diff --git a/src/Squidex/app-config/webpack.run.base.js b/src/Squidex/app-config/webpack.run.base.js index 92315bf46..c9f4cf820 100644 --- a/src/Squidex/app-config/webpack.run.base.js +++ b/src/Squidex/app-config/webpack.run.base.js @@ -38,6 +38,10 @@ module.exports = webpackMerge(commonConfig, { */ new HtmlWebpackPlugin({ template: 'wwwroot/index.html', hash: true + }), + + new HtmlWebpackPlugin({ + template: 'wwwroot/theme.html', hash: true, filename: 'theme.html' }) ] }); \ No newline at end of file diff --git a/src/Squidex/app/framework/services/notification.service.spec.ts b/src/Squidex/app/framework/services/notification.service.spec.ts index 1d880647c..264829bd3 100644 --- a/src/Squidex/app/framework/services/notification.service.spec.ts +++ b/src/Squidex/app/framework/services/notification.service.spec.ts @@ -29,7 +29,7 @@ describe('NotificationService', () => { expect(notification.displayTime).toBe(5000); expect(notification.message).toBe('MyError'); - expect(notification.messageType).toBe('error'); + expect(notification.messageType).toBe('danger'); }); it('should create info', () => { diff --git a/src/Squidex/app/framework/services/notification.service.ts b/src/Squidex/app/framework/services/notification.service.ts index d659c73f4..3fcbdc282 100644 --- a/src/Squidex/app/framework/services/notification.service.ts +++ b/src/Squidex/app/framework/services/notification.service.ts @@ -21,7 +21,7 @@ export class Notification { } public static error(message: string): Notification { - return new Notification(message, 'error'); + return new Notification(message, 'danger'); } public static info(message: string): Notification { diff --git a/src/Squidex/app/shell/pages/internal/internal-area.component.html b/src/Squidex/app/shell/pages/internal/internal-area.component.html index fae983207..6bd8b4266 100644 --- a/src/Squidex/app/shell/pages/internal/internal-area.component.html +++ b/src/Squidex/app/shell/pages/internal/internal-area.component.html @@ -17,7 +17,9 @@
-
+
+ + {{notification.message}}
diff --git a/src/Squidex/app/shell/pages/internal/internal-area.component.scss b/src/Squidex/app/shell/pages/internal/internal-area.component.scss index 7534e924f..4a1893ce7 100644 --- a/src/Squidex/app/shell/pages/internal/internal-area.component.scss +++ b/src/Squidex/app/shell/pages/internal/internal-area.component.scss @@ -54,7 +54,7 @@ &-icon { @include absolute(0, auto, auto, 0); @include border-radius-left(3px); - @include transition(background .4s ease); + @include transition(background-color .4s ease); background: lighten($color-extern-github, 10%); display: inline-block; line-height: 44px; @@ -69,26 +69,8 @@ .notification { &-container { @include fixed(auto, .625rem, .625rem, auto); - width: 20rem; + max-width: 20rem; + min-width: 20rem; z-index: 100000; } - - &-item { - @include border-radius; - @include box-shadow; - padding: .625rem; - margin-top: .625rem; - font-size: .8rem; - font-weight: normal; - color: $color-dark-foreground; - cursor: pointer; - } - - &-error { - background: $color-theme-error; - } - - &-info { - background: $color-theme-blue; - } } \ No newline at end of file diff --git a/src/Squidex/app/shell/pages/internal/internal-area.component.ts b/src/Squidex/app/shell/pages/internal/internal-area.component.ts index 81e65ddbc..c6943ce65 100644 --- a/src/Squidex/app/shell/pages/internal/internal-area.component.ts +++ b/src/Squidex/app/shell/pages/internal/internal-area.component.ts @@ -10,6 +10,7 @@ import { ActivatedRoute } from '@angular/router'; import { Subscription } from 'rxjs'; import { + fadeAnimation, Notification, NotificationService } from 'shared'; @@ -17,7 +18,10 @@ import { @Component({ selector: 'sqx-internal-area', styleUrls: ['./internal-area.component.scss'], - templateUrl: './internal-area.component.html' + templateUrl: './internal-area.component.html', + animations: [ + fadeAnimation + ] }) export class InternalAreaComponent implements OnInit, OnDestroy { private notificationsSubscription: Subscription; diff --git a/src/Squidex/app/theme/_bootstrap-vars.scss b/src/Squidex/app/theme/_bootstrap-vars.scss index 6389ed5bb..e08f5b838 100644 --- a/src/Squidex/app/theme/_bootstrap-vars.scss +++ b/src/Squidex/app/theme/_bootstrap-vars.scss @@ -1,9 +1,31 @@ @import '_mixins.scss'; @import '_vars.scss'; +$font-size-h1: 1.25rem; +$font-size-h2: 1.2rem; +$font-size-h3: 1.15rem; +$font-size-h4: 1.1rem; +$font-size-h5: 1.05rem; +$font-size-h6: 1rem; + +$body-bg: $color-background; + $brand-primary: $color-theme-blue; $brand-success: $color-theme-green; $brand-danger: $color-theme-error; +$brand-warning: $color-theme-orange; + +$alert-success-bg: $color-theme-green; +$alert-success-text: #fff; + +$alert-info-bg: $color-theme-blue; +$alert-info-text: #fff; + +$alert-warning-bg: $color-theme-orange; +$alert-warning-text: #fff; + +$alert-danger-bg: $color-theme-error; +$alert-danger-text: #fff; $btn-secondary-bg: $color-theme-secondary; $btn-secondary-border: $color-theme-secondary; diff --git a/src/Squidex/app/theme/_bootstrap.scss b/src/Squidex/app/theme/_bootstrap.scss index 80fc0d3d0..8b15e0b06 100644 --- a/src/Squidex/app/theme/_bootstrap.scss +++ b/src/Squidex/app/theme/_bootstrap.scss @@ -3,21 +3,6 @@ @import './../../node_modules/bootstrap/scss/mixins/_buttons'; -// -// Override most common header sizes -// -h1 { - font-size: 1.3rem; -} - -h2 { - font-size: 1.1rem; -} - -h3 { - font-size: 1.05rem; -} - // // Bade colors // @@ -53,6 +38,33 @@ h3 { } } +// +// Alert overrides. +// +.alert-info, +.alert-warning, +.alert-info, +.alert-danger { + .alert-link { + color: $color-dark-foreground; + font-size: inherit; + font-weight: normal; + text-decoration: underline; + } + + .close { + & { + font-weight: 400; + font-size: 1.6rem; + } + + &:hover, + &:focus { + color: inherit; + } + } +} + a { &:disabled, &.disabled { @@ -74,6 +86,10 @@ a { line-height: 2.2rem; } + &-toggler { + padding: .18rem .6rem; + } + // Ensure that dropdown is always under nav bar. .dropdown-menu { top: 2.6rem; @@ -335,9 +351,12 @@ a { &-header { @include border-radius-top(.3rem); background: $color-modal-header-background; + font-size: 1rem; + font-weight: normal; + color: $color-modal-header-foreground; - h4 { - color: $color-modal-header-foreground; + h4, + h5 { font-size: 1rem; font-weight: normal; } diff --git a/src/Squidex/app/theme/_vars.scss b/src/Squidex/app/theme/_vars.scss index 0106b4a0d..23bf5a400 100644 --- a/src/Squidex/app/theme/_vars.scss +++ b/src/Squidex/app/theme/_vars.scss @@ -30,6 +30,9 @@ $color-theme-secondary: #dce5e8; $color-theme-green: #4cc159; $color-theme-green-dark: #47b353; +$color-theme-orange: #ffb136; +$color-theme-orange-dark: #a65b00; + $color-theme-error: #f00; $color-theme-error-dark: darken($color-theme-error, 5%); diff --git a/src/Squidex/wwwroot/theme.html b/src/Squidex/wwwroot/theme.html new file mode 100644 index 000000000..c154b3833 --- /dev/null +++ b/src/Squidex/wwwroot/theme.html @@ -0,0 +1,1207 @@ + + + + + + Squidex theme + + + + + + + + +
+
+
+
+ + +
+ +
+ +
+ +
+
+
+
+ +
+ + +
+
+

+ + + + + + + +

+ +

+ + + + + + + +

+ +

+ + + + + + +

+ +
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+ +
+ + + +
+ +
+
+

+ +

+ +
+
+ + + +
+
+ +
+
+ + + +
+
+ +
+
+ + + + + + +
+
+ +
+
+ + + +
+
+ +
+ +
+ +
+
+
+ +
+
+
+ +
+
+ +
+
+
+

Heading 1

+

Heading 2

+

Heading 3

+

Heading 4

+
Heading 5
+
Heading 6
+

Heading with muted text

+ +

Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.

+
+
+
+
+

Example body text

+ +

Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula.

+

The following is rendered as bold text.

+

The following is rendered as italicized text.

+

An abbreviation of the word attribute is attr.

+
+ +
+
+
+

Emphasis classes

+ +

Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.

+

Nullam id dolor id nibh ultricies vehicula ut id elit.

+

Etiam porta sem malesuada magna mollis euismod.

+

Donec ullamcorper nulla non metus auctor fringilla.

+

Duis mollis, est non commodo luctus, nisi erat porttitor ligula.

+

Maecenas sed diam eget risus varius blandit sit amet non magna.

+
+ +
+
+ +
+
+

Blockquotes

+
+
+
+
+
+
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

+
Someone famous in Source Title
+
+
+
+
+
+
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

+
Someone famous in Source Title
+
+
+
+
+
+ +
+
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#Column headingColumn headingColumn heading
1Column contentColumn contentColumn content
2Column contentColumn contentColumn content
3Column contentColumn contentColumn content
4Column contentColumn contentColumn content
5Column contentColumn contentColumn content
6Column contentColumn contentColumn content
7Column contentColumn contentColumn content
+
+
+
+
+ +
+
+
+ +
+
+ +
+
+
+
+
+ Legend +
+ + + We'll never share your email with anyone else. +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + This is some placeholder block-level help text for the above input. It's a bit lighter and easily wraps to a new line. +
+
+ Radio buttons +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+ + +
+
+ +
+
+ + +
+
+ +
+ + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ +
+ +
+
$
+ +
.00
+
+
+
+
+ +
+
+
+ +
+
+
+ +
+
+ +
+
+

Tabs

+
+ +
+
+

Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown + aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan + helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu + banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan + aliquip quis cardigan american apparel, butcher voluptate nisi qui.

+
+
+

Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. + Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan + four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft + beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda + labore aesthetic magna delectus mollit.

+
+
+

Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic + lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork + tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. + DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. +

+
+
+

Trust fund seitan letterpress, keytar raw denim keffiyeh etsy art party before they sold + out master cleanse gluten-free squid scenester freegan cosby sweater. Fanny pack portland + seitan DIY, art party locavore wolf cliche high life echo park Austin. Cred vinyl keffiyeh + DIY salvia PBR, banh mi before they sold out farm-to-table VHS viral locavore cosby sweater. +

+
+
+
+
+ +
+

Pills

+
+ +
+
+
+ +
+
+
+ +
+
+

Breadcrumbs

+
+ + + +
+
+ +
+

Pagination

+
+
+
    +
  • + « +
  • +
  • + 1 +
  • +
  • + 2 +
  • +
  • + 3 +
  • +
  • + 4 +
  • +
  • + 5 +
  • +
  • + » +
  • +
+
+ +
+
    +
  • + « +
  • +
  • + 1 +
  • +
  • + 2 +
  • +
  • + 3 +
  • +
  • + 4 +
  • +
  • + 5 +
  • +
  • + » +
  • +
+
+ +
+
    +
  • + « +
  • +
  • + 1 +
  • +
  • + 2 +
  • +
  • + 3 +
  • +
  • + 4 +
  • +
  • + 5 +
  • +
  • + » +
  • +
+
+ +
+
+
+
+ +
+
+
+ +
+
+ +
+
+

Alerts

+
+
+ +

Warning!

+

Best check yo self, you're not looking too good. Nulla vitae elit libero, a pharetra augue. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

+
+
+
+
+
+
+
+
+ + Oh snap! Change a few things up and try submitting again. +
+
+
+
+
+
+ + Well done! You successfully read this important alert message. +
+
+
+
+
+
+ + Heads up! This alert needs your attention, but it's not super important. +
+
+
+
+
+

Badges

+
+ Default + Primary + Success + Warning + Danger + Info +
+
+ Default + Primary + Success + Warning + Danger + Info +
+
+
+ +
+
+
+ + +

Basic

+
+
+
+
+
+ +

Contextual alternatives

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +

Multiple bars

+
+
+
+
+
+
+
+ +

Striped

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +

Animated

+
+
+
+
+
+
+
+
+
+ +
+
+
+ +
+
+

Jumbotron

+

This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.

+

Learn more

+
+
+
+
+ +
+
+

List groups

+
+
+ + + +
+
+

Cards

+
+
+ +
+
+
+
+
+
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

+
Someone famous in Source Title
+
+
+
+
+
+
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

+
Someone famous in Source Title
+
+
+
+
+
+
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

+
Someone famous in Source Title
+
+
+
+
+
+
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

+
Someone famous in Source Title
+
+
+
+
+
+
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

+
Someone famous in Source Title
+
+
+
+
+
+
+
+
+
+
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

+
Someone famous in Source Title
+
+
+
+
+
+
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

+
Someone famous in Source Title
+
+
+
+
+
+
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

+
Someone famous in Source Title
+
+
+
+
+
+
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

+
Someone famous in Source Title
+
+
+
+
+
+
+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

+
Someone famous in Source Title
+
+
+
+
+
+ +
+
+
+

Card header

+
+
Special title treatment
+
Support card subtitle
+
+ + Card image + +
+

Some quick example text to build on the card title and make up the bulk of the card's content.

+ Card link + Another link +
+ + +
+
+
+
+
+ +
+
+
+ +
+
+
+
+

Modals

+
+ +
+
+ +
+
+ + +
+ + + \ No newline at end of file