]> source.dussan.org Git - vaadin-framework.git/commitdiff
Added boxlayout.scss
authorJouni Koivuviita <jouni@vaadin.com>
Fri, 17 Aug 2012 09:36:52 +0000 (12:36 +0300)
committerJouni Koivuviita <jouni@vaadin.com>
Fri, 17 Aug 2012 09:36:52 +0000 (12:36 +0300)
WebContent/VAADIN/themes/base/base.scss
WebContent/VAADIN/themes/base/boxlayout/boxlayout.scss [new file with mode: 0644]
WebContent/VAADIN/themes/base/styles.scss

index 58f0c32af7057a0a86cae1a520fed113b2acdcc1..efe6e0cd052d0005043de148aff3970f483107d3 100644 (file)
@@ -1,6 +1,7 @@
 @import "absolutelayout/absolutelayout.scss";
 @import "accordion/accordion.scss";
 @import "button/button.scss";
+@import "boxlayout/boxlayout.scss";
 @import "caption/caption.scss";
 @import "common/common.scss";
 @import "csslayout/csslayout.scss";
diff --git a/WebContent/VAADIN/themes/base/boxlayout/boxlayout.scss b/WebContent/VAADIN/themes/base/boxlayout/boxlayout.scss
new file mode 100644 (file)
index 0000000..ef0f021
--- /dev/null
@@ -0,0 +1,171 @@
+/*
+TODO
+- separate styles to proper places
+- decide a good class name structure for core layouts (e.g. 'v-layout', 'v-vertical', 'v-grid' etc.)
+- use !important in carefully selected places to prevent accidental layout breakage by custom theming (e.g. alignments should be forced)
+
+*/
+
+@mixin base-boxlayout {
+
+.v-boxlayout.v-margin-top              {padding-top:           12px;}
+.v-boxlayout.v-margin-right    {padding-right:         12px;}
+.v-boxlayout.v-margin-bottom   {padding-bottom:        12px;}
+.v-boxlayout.v-margin-left             {padding-left:          12px;}
+
+.v-spacing {
+       width: 6px;
+       height: 6px;
+}
+
+.v-boxlayout {
+       display: inline-block;
+}
+
+div.v-boxlayout.v-horizontal.v {
+       white-space: nowrap;
+}
+
+.v-boxlayout > .v-expand {
+       -webkit-box-sizing: border-box;
+       -moz-box-sizing: border-box;
+       box-sizing: border-box;
+       width: 100%;
+       height: 100%;
+}
+
+.v-slot,
+.v-spacing {
+       display: inline-block;
+       white-space: normal;
+       vertical-align: top;
+}
+
+/* Clear any floats inside the slot, to prevent unwanted collapsing */
+.v-vertical > .v-slot:after {
+       content: "";
+       display: inline-block;
+       clear: both;
+       width: 0;
+       height: 0;
+       overflow: hidden;
+}
+
+.v-vertical > .v-slot,
+.v-vertical > .v-expand > .v-slot {
+       display: block;
+       clear: both;
+}
+
+.v-horizontal > .v-slot,
+.v-horizontal > .v-expand > .v-slot {
+       height: 100%;
+}
+
+.v-vertical > .v-spacing,
+.v-vertical > .v-expand > .v-spacing {
+       width: 0;
+       display: block;
+       clear: both;
+}
+
+.v-horizontal > .v-spacing,
+.v-horizontal > .v-expand > .v-spacing {
+       height: 0;
+}
+
+.v-align-middle:before,
+.v-align-bottom:before,
+.v-expand > .v-align-middle:before,
+.v-expand > .v-align-bottom:before {
+       content: "";
+       display: inline-block;
+       height: 100%;
+       vertical-align: middle;
+       width: 0;
+}
+
+.v-align-middle,
+.v-align-bottom {
+       white-space: nowrap;
+}
+
+.v-align-middle > .v,
+.v-align-bottom > .v {
+       display: inline-block;
+}
+
+.v-align-middle,
+.v-align-middle > .v {
+       vertical-align: middle;
+}
+
+.v-align-bottom,
+.v-align-bottom > .v {
+       vertical-align: bottom;
+}
+
+.v-align-center {
+       text-align: center;
+}
+
+.v-align-center > .v {
+       margin-left: auto;
+       margin-right: auto;
+}
+
+.v-align-right {
+       text-align: right;
+}
+
+.v-align-right > .v {
+       margin-left: auto;
+}
+
+.v-has-caption,
+.v-has-caption > .v-caption {
+       display: inline-block; /* Force natural width to zero */
+}
+
+.v-caption {
+       overflow: visible;
+       vertical-align: middle;
+}
+
+.v-caption-on-left,
+.v-caption-on-right {
+       white-space: nowrap;
+}
+
+.v-caption-on-top > .v-caption,
+.v-caption-on-bottom > .v-caption {
+       display: block;
+}
+
+.v-caption-on-left > .v-caption {
+       padding-right: .5em;
+}
+
+.v-caption-on-right > .v-caption {
+       padding-left: .5em;
+}
+
+.v-caption-on-left > .v,
+.v-caption-on-right > .v {
+       display: inline-block;
+       vertical-align: middle;
+}
+
+.v-has-caption.v-has-width > .v {
+       width: 100% !important;
+}
+
+.v-has-caption.v-has-height > .v {
+       height: 100% !important;
+}
+
+.v-errorindicator {
+       vertical-align: middle;
+}
+
+}
\ No newline at end of file
index a1bf1ec42c68ce92b088318d0a94aaf1b382485e..7a650d081869a286152f694c4925f17ed5401339 100644 (file)
@@ -15,6 +15,7 @@
 // here for now to preserve old semantics
 @include base-common;
 
+@include base-boxlayout;
 @include base-csslayout;
 @include base-customcomponent;
 @include base-customlayout;