Browse Source

Reverts #2061 scrollbar changes, adds blurring/inverted settings in modal settings

pull/2169/head
jlukic 10 years ago
parent
commit
46198c9fea
4 changed files with 73 additions and 37 deletions
  1. 11
      src/definitions/modules/dimmer.less
  2. 13
      src/definitions/modules/modal.js
  3. 48
      src/definitions/modules/modal.less
  4. 38
      src/themes/default/modules/modal.variables

11
src/definitions/modules/dimmer.less

@ -106,19 +106,24 @@
transform-origin: center center; transform-origin: center center;
} }
body.animating.in.dimmable,
body.dimmed.dimmable {
overflow: hidden;
}
body.dimmable > .dimmer { body.dimmable > .dimmer {
position: fixed; position: fixed;
} }
/*-------------- /*--------------
Blurring
Blurring
---------------*/ ---------------*/
.blurring.dimmable > :not(.dimmer) {
.blurring.dimmable > :not(.dimmer) > * {
filter: @blurredStartFilter; filter: @blurredStartFilter;
transition: @blurredTransition; transition: @blurredTransition;
} }
.blurring.dimmed.dimmable > :not(.dimmer) {
.blurring.dimmed.dimmable > :not(.dimmer) > * {
filter: @blurredEndFilter; filter: @blurredEndFilter;
} }

13
src/definitions/modules/modal.js

@ -106,6 +106,12 @@ $.fn.modal = function(parameters) {
}, },
dimmerSettings = $.extend(true, defaultSettings, settings.dimmerSettings) dimmerSettings = $.extend(true, defaultSettings, settings.dimmerSettings)
; ;
if(settings.inverted) {
dimmerSettings.variation = (dimmerSettings.variation !== undefined)
? dimmer.settings.variation + ' inverted'
: 'inverted'
;
}
if($.fn.dimmer === undefined) { if($.fn.dimmer === undefined) {
module.error(error.dimmer); module.error(error.dimmer);
return; return;
@ -119,6 +125,9 @@ $.fn.modal = function(parameters) {
else { else {
module.set.undetached(); module.set.undetached();
} }
if(settings.blurring) {
$dimmable.addClass(className.blurring);
}
$dimmer = $dimmable.dimmer('get dimmer'); $dimmer = $dimmable.dimmer('get dimmer');
}, },
id: function() { id: function() {
@ -829,6 +838,9 @@ $.fn.modal.settings = {
closable : true, closable : true,
autofocus : true, autofocus : true,
inverted : true,
blurring : true,
dimmerSettings : { dimmerSettings : {
closable : false, closable : false,
useCSS : true useCSS : true
@ -877,6 +889,7 @@ $.fn.modal.settings = {
className : { className : {
active : 'active', active : 'active',
animating : 'animating', animating : 'animating',
blurring : 'blurring',
scrolling : 'scrolling', scrolling : 'scrolling',
undetached : 'undetached' undetached : 'undetached'
} }

48
src/definitions/modules/modal.less

@ -32,9 +32,6 @@
left: 50%; left: 50%;
text-align: left; text-align: left;
width: @width;
margin-left: @xOffset;
background: @background; background: @background;
border: @border; border: @border;
box-shadow: @boxShadow; box-shadow: @boxShadow;
@ -106,8 +103,7 @@
---------------*/ ---------------*/
.ui.modal > .content { .ui.modal > .content {
display: table;
table-layout: fixed;
display: flex;
width: 100%; width: 100%;
font-size: @contentFontSize; font-size: @contentFontSize;
line-height: @contentLineHeight; line-height: @contentLineHeight;
@ -117,26 +113,32 @@
/* Image */ /* Image */
.ui.modal > .content > .image { .ui.modal > .content > .image {
display: table-cell;
display: block;
flex: 0 1 auto;
width: @imageWidth; width: @imageWidth;
vertical-align: @imageVerticalAlign;
align-self: @imageVerticalAlign;
} }
.ui.modal > .content > .image[class*="top aligned"] {
vertical-align: top;
.ui.modal > [class*="top aligned"] {
align-self: top;
} }
.ui.modal > .content > .image[class*="middle aligned"] {
vertical-align: middle;
.ui.modal > [class*="middle aligned"] {
align-self: middle;
}
.ui.modal > [class*="stretched"] {
align-self: stretch;
} }
/* Description */ /* Description */
.ui.modal > .content > .description { .ui.modal > .content > .description {
display: table-cell;
vertical-align: top;
vertical-align: @descriptionVerticalAlign;
display: block;
flex: 1 0 auto;
min-width: 0px;
align-self: @descriptionVerticalAlign;
} }
.ui.modal > .content > .icon + .description, .ui.modal > .content > .icon + .description,
.ui.modal > .content > .image + .description { .ui.modal > .content > .image + .description {
flex: 0 1 auto;
min-width: @descriptionMinWidth; min-width: @descriptionMinWidth;
width: @descriptionWidth; width: @descriptionWidth;
padding-left: @descriptionDistance; padding-left: @descriptionDistance;
@ -260,6 +262,14 @@
} }
} }
/*--------------
Coupling
---------------*/
.ui.inverted.dimmer > .ui.modal {
box-shadow: @invertedBoxShadow;
}
/******************************* /*******************************
Types Types
*******************************/ *******************************/
@ -268,7 +278,7 @@
background-color: transparent; background-color: transparent;
border: none; border: none;
border-radius: 0em; border-radius: 0em;
box-shadow: 0px 0px 0px 0px;
box-shadow: none !important;
color: @basicModalColor; color: @basicModalColor;
} }
.ui.basic.modal > .header, .ui.basic.modal > .header,
@ -284,9 +294,15 @@
right: @basicModalCloseRight; right: @basicModalCloseRight;
} }
.ui.inverted.dimmer > .basic.modal {
color: @basicInvertedModalColor;
}
.ui.inverted.dimmer > .ui.basic.modal > .header {
color: @basicInvertedModalHeaderColor;
}
/* Tablet and Mobile */ /* Tablet and Mobile */
@media only screen and (max-width : @computerBreakpoint) { @media only screen and (max-width : @computerBreakpoint) {
.ui.basic.modal > .close { .ui.basic.modal > .close {
color: @basicInnerCloseColor; color: @basicInnerCloseColor;
} }

38
src/themes/default/modules/modal.variables

@ -4,11 +4,9 @@
@background: @white; @background: @white;
@border: none; @border: none;
@width: 90%;
@zIndex: 1001; @zIndex: 1001;
@xOffset: -(@width / 2);
@borderRadius: @defaultBorderRadius; @borderRadius: @defaultBorderRadius;
@boxShadow: 0 1px 4px 1px rgba(0, 0, 0, 0.3);
@boxShadow: 1px 3px 10px 2px rgba(0, 0, 0, 0.5);
/* Close Icon */ /* Close Icon */
@closeOpacity: 0.8; @closeOpacity: 0.8;
@ -24,21 +22,20 @@
/* Header */ /* Header */
@headerMargin: 0em; @headerMargin: 0em;
@headerVerticalPadding: 1.2rem;
@headerHorizontalPadding: 2rem;
@headerVerticalPadding: 1.25rem;
@headerHorizontalPadding: 1.5rem;
@headerPadding: @headerVerticalPadding @headerHorizontalPadding; @headerPadding: @headerVerticalPadding @headerHorizontalPadding;
@headerBackground: @subtleGradient @white;
@headerBackground: @white;
@headerColor: @darkTextColor; @headerColor: @darkTextColor;
@headerFontSize: 1.6em;
@headerLineHeight: 1.3em;
@headerBoxShadow: @subtleShadow;
@headerFontSize: @huge;
@headerBoxShadow: none;
@headerFontWeight: bold; @headerFontWeight: bold;
@headerFontFamily: @headerFont; @headerFontFamily: @headerFont;
@headerBorder: 1px solid @borderColor; @headerBorder: 1px solid @borderColor;
/* Content */ /* Content */
@contentFontSize: 1em; @contentFontSize: 1em;
@contentPadding: 2rem;
@contentPadding: 1.5rem;
@contentLineHeight: 1.4; @contentLineHeight: 1.4;
@contentBackground: #FFFFFF; @contentBackground: #FFFFFF;
@ -49,13 +46,13 @@
@descriptionDistance: 2em; @descriptionDistance: 2em;
@descriptionMinWidth: ''; @descriptionMinWidth: '';
@descriptionWidth: 80%;
@descriptionWidth: auto;
@descriptionVerticalAlign: top; @descriptionVerticalAlign: top;
/* Modal Actions */ /* Modal Actions */
@actionBorder: 1px solid @borderColor; @actionBorder: 1px solid @borderColor;
@actionBackground: #EFEFEF;
@actionPadding: 1rem 2rem;
@actionBackground: @offWhite;
@actionPadding: 1rem 1rem;
@actionAlign: right; @actionAlign: right;
@buttonDistance: 0.75em; @buttonDistance: 0.75em;
@ -76,13 +73,12 @@
@mobileCloseTop: 0.5rem; @mobileCloseTop: 0.5rem;
@mobileCloseRight: 0.5rem; @mobileCloseRight: 0.5rem;
/* Responsive Widths */ /* Responsive Widths */
@mobileWidth: 95%; @mobileWidth: 95%;
@tabletWidth: 88%; @tabletWidth: 88%;
@computerWidth: 74%;
@largeMonitorWidth: 56%;
@widescreenMonitorWidth: 42%;
@computerWidth: 850px;
@largeMonitorWidth: 900px;
@widescreenMonitorWidth: 950px;
@mobileMargin: 0em 0em 0em -(@mobileWidth / 2); @mobileMargin: 0em 0em 0em -(@mobileWidth / 2);
@tabletMargin: 0em 0em 0em -(@tabletWidth / 2); @tabletMargin: 0em 0em 0em -(@tabletWidth / 2);
@ -94,6 +90,9 @@
@fullScreenOffset: (100% - @fullScreenWidth) / 2; @fullScreenOffset: (100% - @fullScreenWidth) / 2;
@fullScreenMargin: 1em auto; @fullScreenMargin: 1em auto;
/* Coupling */
@invertedBoxShadow: 1px 3px 10px 2px rgba(0, 0, 0, 0.2);
/*------------------- /*-------------------
Types Types
--------------------*/ --------------------*/
@ -105,6 +104,9 @@
@basicModalCloseRight: 1.5rem; @basicModalCloseRight: 1.5rem;
@basicInnerCloseColor: @white; @basicInnerCloseColor: @white;
@basicInvertedModalColor: @textColor;
@basicInvertedModalHeaderColor: @darkTextColor;
/* Scrolling Margin */ /* Scrolling Margin */
@scrollingMargin: 3.5rem; @scrollingMargin: 3.5rem;
@mobileScrollingMargin: 1rem; @mobileScrollingMargin: 1rem;
@ -114,7 +116,7 @@
--------------------*/ --------------------*/
/* Size Widths */ /* Size Widths */
@smallRatio: 0.6;
@smallRatio: 0.8;
@largeRatio: 1.2; @largeRatio: 1.2;
/* Derived Responsive Sizes */ /* Derived Responsive Sizes */

Loading…
Cancel
Save