github.com/fanux/shipyard@v0.0.0-20161009071005-6515ce223235/controller/static/semantic/src/definitions/modules/modal.less (about)

     1  /*!
     2   * # Semantic UI - Modal
     3   * http://github.com/semantic-org/semantic-ui/
     4   *
     5   *
     6   * Copyright 2014 Contributors
     7   * Released under the MIT license
     8   * http://opensource.org/licenses/MIT
     9   *
    10   */
    11  
    12  
    13  /*******************************
    14              Theme
    15  *******************************/
    16  
    17  @type    : 'module';
    18  @element : 'modal';
    19  
    20  @import (multiple) '../../theme.config';
    21  
    22  /*******************************
    23               Modal
    24  *******************************/
    25  
    26  .ui.modal {
    27    display: none;
    28    position: fixed;
    29    z-index: @zIndex;
    30  
    31    top: 50%;
    32    left: 50%;
    33    text-align: left;
    34  
    35    width: @width;
    36    margin-left: @xOffset;
    37  
    38    background: @background;
    39    border: @border;
    40    box-shadow: @boxShadow;
    41  
    42    border-radius: @borderRadius;
    43    user-select: text;
    44    will-change: top, left, margin, transform, opacity;
    45  }
    46  
    47  .ui.modal > :first-child:not(.icon),
    48  .ui.modal > .icon:first-child + * {
    49    border-top-left-radius: @borderRadius;
    50    border-top-right-radius: @borderRadius;
    51  }
    52  
    53  .ui.modal > :last-child {
    54    border-bottom-left-radius: @borderRadius;
    55    border-bottom-right-radius: @borderRadius;
    56  }
    57  
    58  /*******************************
    59              Content
    60  *******************************/
    61  
    62  /*--------------
    63       Close
    64  ---------------*/
    65  
    66  .ui.modal > .close {
    67    cursor: pointer;
    68    position: absolute;
    69    top: @closeTop;
    70    right: @closeRight;
    71    z-index: 1;
    72  
    73    opacity: @closeOpacity;
    74    font-size: @closeSize;
    75    color: @closeColor;
    76  
    77    width: @closeHitbox;
    78    height: @closeHitbox;
    79    padding: @closePadding;
    80  }
    81  .ui.modal > .close:hover {
    82    opacity: 1;
    83  }
    84  
    85  /*--------------
    86       Header
    87  ---------------*/
    88  
    89  .ui.modal > .header {
    90    display: block;
    91    font-family: @headerFontFamily;
    92    background: @headerBackground;
    93    margin: @headerMargin;
    94    padding: @headerPadding;
    95    box-shadow: @headerBoxShadow;
    96  
    97    font-size: @headerFontSize;
    98    line-height: @headerLineHeight;
    99    font-weight: @headerFontWeight;
   100    color: @headerColor;
   101    border-bottom: @headerBorder;
   102  }
   103  
   104  /*--------------
   105       Content
   106  ---------------*/
   107  
   108  .ui.modal > .content {
   109    display: table;
   110    table-layout: fixed;
   111    width: 100%;
   112    font-size: @contentFontSize;
   113    line-height: @contentLineHeight;
   114    padding: @contentPadding;
   115    background: @contentBackground;
   116  }
   117  
   118  /* Image */
   119  .ui.modal > .content > .image {
   120    display: table-cell;
   121    width: @imageWidth;
   122    vertical-align: @imageVerticalAlign;
   123  }
   124  .ui.modal > .content > .image[class*="top aligned"] {
   125    vertical-align: top;
   126  }
   127  .ui.modal > .content > .image[class*="middle aligned"] {
   128    vertical-align: middle;
   129  }
   130  
   131  /* Description */
   132  .ui.modal > .content > .description {
   133    display: table-cell;
   134    vertical-align: top;
   135    vertical-align: @descriptionVerticalAlign;
   136  }
   137  
   138  .ui.modal > .content > .icon + .description,
   139  .ui.modal > .content > .image + .description {
   140    min-width: @descriptionMinWidth;
   141    width: @descriptionWidth;
   142    padding-left: @descriptionDistance;
   143  }
   144  
   145  /*rtl:ignore*/
   146  .ui.modal > .content > .image > i.icon {
   147    font-size: @imageIconSize;
   148    margin: 0em;
   149    opacity: 1;
   150    width: auto;
   151  }
   152  
   153  /*--------------
   154       Actions
   155  ---------------*/
   156  
   157  .ui.modal .actions {
   158    background: @actionBackground;
   159    padding: @actionPadding;
   160    border-top: @actionBorder;
   161    text-align: @actionAlign;
   162  }
   163  .ui.modal .actions > .button {
   164    margin-left: @buttonDistance;
   165  }
   166  
   167  /*-------------------
   168         Responsive
   169  --------------------*/
   170  
   171  /* Modal Width */
   172  @media only screen and (max-width : @largestMobileScreen) {
   173    .ui.modal {
   174      width: @mobileWidth;
   175      margin: @mobileMargin;
   176    }
   177  }
   178  @media only screen and (min-width : @tabletBreakpoint) {
   179    .ui.modal {
   180      width: @tabletWidth;
   181      margin: @tabletMargin;
   182    }
   183  }
   184  @media only screen and (min-width : @computerBreakpoint) {
   185    .ui.modal {
   186      width: @computerWidth;
   187      margin: @computerMargin;
   188    }
   189  }
   190  @media only screen and (min-width : @largeMonitorBreakpoint) {
   191    .ui.modal {
   192      width: @largeMonitorWidth;
   193      margin: @largeMonitorMargin;
   194    }
   195  }
   196  @media only screen and (min-width : @widescreenMonitorBreakpoint) {
   197    .ui.modal {
   198      width: @widescreenMonitorWidth;
   199      margin: @widescreenMonitorMargin;
   200    }
   201  }
   202  
   203  /* Tablet and Mobile */
   204  @media only screen and (max-width : @computerBreakpoint) {
   205    .ui.modal > .header {
   206      padding-right: @closeHitbox;
   207    }
   208    .ui.modal > .close {
   209      top: @innerCloseTop;
   210      right: @innerCloseRight;
   211      color: @innerCloseColor;
   212    }
   213  }
   214  
   215  /* Mobile */
   216  @media only screen and (max-width : @largestMobileScreen) {
   217  
   218    .ui.modal > .header {
   219      padding: @mobileHeaderPadding !important;
   220      padding-right: @closeHitbox !important;
   221    }
   222    .ui.modal > .content {
   223      display: block;
   224      padding: @mobileContentPadding !important;
   225    }
   226    .ui.modal > .close {
   227      top: @mobileCloseTop !important;
   228      right: @mobileCloseRight !important;
   229    }
   230  
   231    /*rtl:ignore*/
   232    .ui.modal .content > .image {
   233      display: block;
   234      max-width: 100%;
   235      margin: 0em auto !important;
   236      text-align: center;
   237      padding: @mobileImagePadding !important;
   238    }
   239    .ui.modal > .content > .image > i.icon {
   240      font-size: @mobileImageIconSize;
   241      text-align: center;
   242    }
   243  
   244    /*rtl:ignore*/
   245    .ui.modal .content > .description {
   246      display: block;
   247      width: 100% !important;
   248      margin: 0em !important;
   249      padding: @mobileDescriptionPadding !important;
   250      box-shadow: none;
   251    }
   252  
   253    /* Let Buttons Stack */
   254    .ui.modal > .actions {
   255      padding: @mobileActionPadding !important;
   256    }
   257    .ui.modal .actions > .buttons,
   258    .ui.modal .actions > .button {
   259      margin-bottom: @mobileButtonDistance;
   260    }
   261  }
   262  
   263  /*******************************
   264               Types
   265  *******************************/
   266  
   267  .ui.basic.modal {
   268    background-color: transparent;
   269    border: none;
   270    border-radius: 0em;
   271    box-shadow: 0px 0px 0px 0px;
   272    color: @basicModalColor;
   273  }
   274  .ui.basic.modal > .header,
   275  .ui.basic.modal > .content,
   276  .ui.basic.modal > .actions {
   277    background-color: transparent;
   278  }
   279  .ui.basic.modal > .header {
   280    color: @basicModalHeaderColor;
   281  }
   282  .ui.basic.modal > .close {
   283    top: @basicModalCloseTop;
   284    right: @basicModalCloseRight;
   285  }
   286  
   287  /* Tablet and Mobile */
   288  @media only screen and (max-width : @computerBreakpoint) {
   289  
   290    .ui.basic.modal > .close {
   291      color: @basicInnerCloseColor;
   292    }
   293  }
   294  
   295  /*******************************
   296              Variations
   297  *******************************/
   298  
   299  /* A modal that cannot fit on the page */
   300  .scrolling.dimmable.dimmed {
   301    overflow: hidden;
   302  }
   303  .scrolling.dimmable.dimmed > .dimmer {
   304    overflow: auto;
   305    -webkit-overflow-scrolling: touch;
   306  }
   307  .scrolling.dimmable > .dimmer {
   308    position: fixed;
   309  }
   310  
   311  .ui.scrolling.modal {
   312    position: static;
   313    margin: @scrollingMargin auto !important;
   314  }
   315  
   316  @media only screen and (max-width : @computerBreakpoint) {
   317    .ui.scrolling.modal {
   318      margin-top: @mobileScrollingMargin;
   319      margin-bottom: @mobileScrollingMargin;
   320    }
   321  }
   322  
   323  /*******************************
   324               States
   325  *******************************/
   326  
   327  .ui.active.modal {
   328    display: block;
   329  }
   330  
   331  /*******************************
   332             Variations
   333  *******************************/
   334  
   335  /*--------------
   336     Full Screen
   337  ---------------*/
   338  
   339  .ui.fullscreen.modal {
   340    width: @fullScreenWidth !important;
   341    left: @fullScreenOffset !important;
   342    margin: @fullScreenMargin;
   343  }
   344  .ui.fullscreen.scrolling.modal {
   345    left: 0em !important;
   346  }
   347  .ui.fullscreen.modal > .header {
   348    padding-right: @closeHitbox;
   349  }
   350  .ui.fullscreen.modal > .close {
   351    top: @innerCloseTop;
   352    right: @innerCloseRight;
   353    color: @innerCloseColor;
   354  }
   355  
   356  
   357  /*--------------
   358        Size
   359  ---------------*/
   360  
   361  .ui.modal {
   362    font-size: @medium;
   363  }
   364  
   365  /* Small */
   366  .ui.small.modal > .header {
   367    font-size: @smallHeaderSize;
   368  }
   369  
   370  /* Small Modal Width */
   371  @media only screen and (max-width : @largestMobileScreen) {
   372    .ui.small.modal {
   373      width: @smallMobileWidth;
   374      margin: @smallMobileMargin;
   375    }
   376  }
   377  @media only screen and (min-width : @tabletBreakpoint) {
   378    .ui.small.modal {
   379      width: @smallTabletWidth;
   380      margin: @smallTabletMargin;
   381    }
   382  }
   383  @media only screen and (min-width : @computerBreakpoint) {
   384    .ui.small.modal {
   385      width: @smallComputerWidth;
   386      margin: @smallComputerMargin;
   387    }
   388  }
   389  @media only screen and (min-width : @largeMonitorBreakpoint) {
   390    .ui.small.modal {
   391      width: @smallLargeMonitorWidth;
   392      margin: @smallLargeMonitorMargin;
   393    }
   394  }
   395  @media only screen and (min-width : @widescreenMonitorBreakpoint) {
   396    .ui.small.modal {
   397      width: @smallWidescreenMonitorWidth;
   398      margin: @smallWidescreenMonitorMargin;
   399    }
   400  }
   401  
   402  /* Large Modal Width */
   403  .ui.large.modal > .header {
   404    font-size: @largeHeaderSize;
   405  }
   406  @media only screen and (max-width : @largestMobileScreen) {
   407    .ui.large.modal {
   408      width: @largeMobileWidth;
   409      margin: @largeMobileMargin;
   410    }
   411  }
   412  @media only screen and (min-width : @tabletBreakpoint) {
   413    .ui.large.modal {
   414      width: @largeTabletWidth;
   415      margin: @largeTabletMargin;
   416    }
   417  }
   418  @media only screen and (min-width : @computerBreakpoint) {
   419    .ui.large.modal {
   420      width: @largeComputerWidth;
   421      margin: @largeComputerMargin;
   422    }
   423  }
   424  @media only screen and (min-width : @largeMonitorBreakpoint) {
   425    .ui.large.modal {
   426      width: @largeLargeMonitorWidth;
   427      margin: @largeLargeMonitorMargin;
   428    }
   429  }
   430  @media only screen and (min-width : @widescreenMonitorBreakpoint) {
   431    .ui.large.modal {
   432      width: @largeWidescreenMonitorWidth;
   433      margin: @largeWidescreenMonitorMargin;
   434    }
   435  }
   436  
   437  
   438  .loadUIOverrides();