SafetyScreen-ui/node_modules/vue-grid-layout/website/public/guide/styling.html

80 lines
18 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Styling | Vue Grid Layout - A grid layout system for Vue.js</title>
<meta name="generator" content="VuePress 1.9.7">
<link rel="icon" href="/vue-grid-layout/favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="https://jbaysolutions.github.io/vue-grid-layout/assets/favicon/apple-touch-icon.png">
<meta name="description" content="A draggable and resizable grid layout, as a Vue component.">
<meta property="article:modified_time" content="2020-11-06T18:30:41.000Z">
<meta property="og:title" content="Styling — Vue Grid Layout">
<meta property="og:description" content="A draggable and resizable grid layout, as a Vue component.">
<meta property="og:type" content="article">
<meta property="og:url" content="/guide/styling.html">
<meta name="twitter:title" content="Styling — Vue Grid Layout">
<meta name="twitter:description" content="A draggable and resizable grid layout, as a Vue component.">
<meta name="twitter:url" content="/guide/styling.html">
<meta name="twitter:card" content="summary_large_image">
<link rel="preload" href="/vue-grid-layout/assets/css/0.styles.62040b1f.css" as="style"><link rel="preload" href="/vue-grid-layout/assets/js/app.3b46d3a7.js" as="script"><link rel="preload" href="/vue-grid-layout/assets/js/5.fbd53fc9.js" as="script"><link rel="preload" href="/vue-grid-layout/assets/js/4.9a10d8f3.js" as="script"><link rel="preload" href="/vue-grid-layout/assets/js/42.f7542798.js" as="script"><link rel="prefetch" href="/vue-grid-layout/assets/js/1.f5920396.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/10.b35cd169.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/11.33825800.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/12.1a4f2982.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/13.d9abf441.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/14.2ee2c0bb.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/15.dda8bb4d.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/16.decab905.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/17.17d1fea8.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/18.072d74f9.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/19.a5bd48b6.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/20.a6f7c401.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/21.f07a4293.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/22.8c77b52b.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/23.166522b1.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/24.f224653c.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/25.123f3476.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/26.3627e157.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/27.24596d70.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/28.de97d8c2.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/29.902100f1.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/30.6bfee860.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/31.567ea2fd.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/32.72b82452.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/33.6b852b0b.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/34.35990edb.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/35.8b6fa6f0.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/36.a0e45802.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/37.bd32d898.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/38.a192efbf.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/39.85b7f492.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/40.d8f3d249.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/41.d0334a36.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/43.d5ada079.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/44.690b0248.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/45.c4a5f6c2.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/46.d847dd7f.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/47.44f6af27.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/48.fc0b14e5.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/49.dd4cba1a.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/50.4186651e.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/51.32fc51c3.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/52.2124af42.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/53.a5360cb7.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/54.7a70587f.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/55.65df1d6e.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/56.2bde5fd7.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/57.f38265c1.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/58.7970354a.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/59.af080563.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/6.eae6137a.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/60.3afbbfc8.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/61.8b9ba428.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/62.a0c81243.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/63.d8c2ffd8.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/7.c2af6ee4.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/8.b45e893b.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/9.b9c5a1a2.js"><link rel="prefetch" href="/vue-grid-layout/assets/js/vendors~docsearch.254ba4e3.js">
<link rel="stylesheet" href="/vue-grid-layout/assets/css/0.styles.62040b1f.css">
</head>
<body>
<div id="app" data-server-rendered="true"><div class="theme-container" data-v-6394a605><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/vue-grid-layout/" class="home-link router-link-active"><img src="/vue-grid-layout/assets/img/logo.png" alt="Vue Grid Layout - A grid layout system for Vue.js" class="logo"> <span class="site-name can-hide">Vue Grid Layout - A grid layout system for Vue.js</span></a> <div class="links"><form id="search-form" role="search" class="algolia-search-wrapper search-box"><input id="algolia-search-input" class="search-query"></form> <nav class="nav-links can-hide"><div class="nav-item"><a href="/vue-grid-layout/" class="nav-link">
Home
</a></div><div class="nav-item"><a href="/vue-grid-layout/guide/" class="nav-link router-link-active">
Guide
</a></div><div class="nav-item"><a href="/vue-grid-layout/changelog/" class="nav-link">
Changelog
</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="Select language" class="dropdown-title"><span class="title">Languages</span> <span class="arrow down"></span></button> <button type="button" aria-label="Select language" class="mobile-dropdown-title"><span class="title">Languages</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/vue-grid-layout/guide/styling.html" aria-current="page" class="nav-link router-link-exact-active router-link-active">
English
</a></li><li class="dropdown-item"><!----> <a href="/vue-grid-layout/zh/guide/styling.html" class="nav-link">
简体中文
</a></li></ul></div></div> <a href="https://github.com/jbaysolutions/vue-grid-layout" target="_blank" rel="noopener noreferrer" class="repo-link">
GitHub
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/vue-grid-layout/" class="nav-link">
Home
</a></div><div class="nav-item"><a href="/vue-grid-layout/guide/" class="nav-link router-link-active">
Guide
</a></div><div class="nav-item"><a href="/vue-grid-layout/changelog/" class="nav-link">
Changelog
</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="Select language" class="dropdown-title"><span class="title">Languages</span> <span class="arrow down"></span></button> <button type="button" aria-label="Select language" class="mobile-dropdown-title"><span class="title">Languages</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/vue-grid-layout/guide/styling.html" aria-current="page" class="nav-link router-link-exact-active router-link-active">
English
</a></li><li class="dropdown-item"><!----> <a href="/vue-grid-layout/zh/guide/styling.html" class="nav-link">
简体中文
</a></li></ul></div></div> <a href="https://github.com/jbaysolutions/vue-grid-layout" target="_blank" rel="noopener noreferrer" class="repo-link">
GitHub
<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav> <div class="carbon-ads" data-v-6394a605></div> <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>Guide</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/vue-grid-layout/guide/" aria-current="page" class="sidebar-link">Installation</a></li><li><a href="/vue-grid-layout/guide/usage.html" class="sidebar-link">Usage</a></li><li><a href="/vue-grid-layout/guide/properties.html" class="sidebar-link">Properties</a></li><li><a href="/vue-grid-layout/guide/events.html" class="sidebar-link">Events</a></li><li><a href="/vue-grid-layout/guide/styling.html" aria-current="page" class="active sidebar-link">Styling</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/vue-grid-layout/guide/styling.html#placeholder" class="sidebar-link">Placeholder</a></li></ul></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>Examples</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/vue-grid-layout/guide/01-basic.html" class="sidebar-link">01 - Basic</a></li><li><a href="/vue-grid-layout/guide/02-events.html" class="sidebar-link">02 - Move and resize events</a></li><li><a href="/vue-grid-layout/guide/03-multiple-grids.html" class="sidebar-link">03 - Multiple grids</a></li><li><a href="/vue-grid-layout/guide/04-allow-ignore.html" class="sidebar-link">04 - Drag allow/ignore elements</a></li><li><a href="/vue-grid-layout/guide/05-mirrored.html" class="sidebar-link">05 - Mirrored grid layout</a></li><li><a href="/vue-grid-layout/guide/06-responsive.html" class="sidebar-link">06 - Responsive</a></li><li><a href="/vue-grid-layout/guide/07-prevent-collision.html" class="sidebar-link">07 - Prevent Collision</a></li><li><a href="/vue-grid-layout/guide/08-responsive-predefined-layouts.html" class="sidebar-link">08 - Responsive with predefined layouts</a></li><li><a href="/vue-grid-layout/guide/09-dynamic-add-remove.html" class="sidebar-link">09 - Dynamic Add/Remove</a></li><li><a href="/vue-grid-layout/guide/10-drag-from-outside.html" class="sidebar-link">10 - Drag From Outside</a></li><li><a href="/vue-grid-layout/guide/11-bounded.html" class="sidebar-link">11 - Dragging grid items bounded to grid container</a></li></ul></section></li></ul> <footer class="footer" data-v-6394a605>
A product by:
<a href="https://www.jbaysolutions.com/" target="_blank" rel="noopener" class="footer-card" data-v-6394a605><img src="/vue-grid-layout/assets/img/logo-jbay.png" alt="JBay Solutions" data-v-6394a605></a></footer></aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="styling"><a href="#styling" class="header-anchor">#</a> Styling</h1> <p>Grid styling can be customized to fit your needs. Below is a list of the classes you can override.</p> <h2 id="placeholder"><a href="#placeholder" class="header-anchor">#</a> Placeholder</h2> <p>The default css for the placeholder is:</p> <div class="language-css extra-class"><pre class="language-css"><code><span class="token selector">.vue-grid-item.vue-grid-placeholder</span> <span class="token punctuation">{</span>
<span class="token property">background</span><span class="token punctuation">:</span> red<span class="token punctuation">;</span>
<span class="token property">opacity</span><span class="token punctuation">:</span> 0.2<span class="token punctuation">;</span>
<span class="token property">transition-duration</span><span class="token punctuation">:</span> 100ms<span class="token punctuation">;</span>
<span class="token property">z-index</span><span class="token punctuation">:</span> 2<span class="token punctuation">;</span>
<span class="token property">-webkit-user-select</span><span class="token punctuation">:</span> none<span class="token punctuation">;</span>
<span class="token property">-moz-user-select</span><span class="token punctuation">:</span> none<span class="token punctuation">;</span>
<span class="token property">-ms-user-select</span><span class="token punctuation">:</span> none<span class="token punctuation">;</span>
<span class="token property">-o-user-select</span><span class="token punctuation">:</span> none<span class="token punctuation">;</span>
<span class="token property">user-select</span><span class="token punctuation">:</span> none<span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre></div><p>You can override the properties using the !important rule:</p> <div class="language-css extra-class"><pre class="language-css"><code><span class="token selector">.vue-grid-item.vue-grid-placeholder</span> <span class="token punctuation">{</span>
<span class="token property">background</span><span class="token punctuation">:</span> green <span class="token important">!important</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre></div><p>Or by wrapping your grid with a more <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity" target="_blank" rel="noopener noreferrer">specific<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> class:</p> <div class="language-css extra-class"><pre class="language-css"><code><span class="token selector">.container .vue-grid-item.vue-grid-placeholder</span> <span class="token punctuation">{</span>
<span class="token property">background</span><span class="token punctuation">:</span> green<span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre></div><p>In this example we change the placeholder background color to green:</p> <p><a href="https://github.com/jbaysolutions/vue-grid-layout/blob/master/website/docs/.vuepress/components/ExampleStylingPlaceholder.vue" target="_blank" rel="noopener noreferrer">View source<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <!----> <p>Work in progress...</p></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/jbaysolutions/vue-grid-layout/edit/master/website/docs/guide/styling.md" target="_blank" rel="noopener noreferrer">Help improve this page!</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div> <div class="last-updated"><span class="prefix">Last Updated:</span> <span class="time">11/6/2020, 6:30:41 PM</span></div></footer> <div class="page-nav"><p class="inner"><span class="prev">
<a href="/vue-grid-layout/guide/events.html" class="prev">
Events
</a></span> <span class="next"><a href="/vue-grid-layout/guide/01-basic.html">
01 - Basic
</a>
</span></p></div> </main></div><div class="global-ui"><!----></div></div>
<script src="/vue-grid-layout/assets/js/app.3b46d3a7.js" defer></script><script src="/vue-grid-layout/assets/js/5.fbd53fc9.js" defer></script><script src="/vue-grid-layout/assets/js/4.9a10d8f3.js" defer></script><script src="/vue-grid-layout/assets/js/42.f7542798.js" defer></script>
</body>
</html>