@ciar4n/izmir
Version:
An image hover mini CSS library
243 lines (196 loc) • 11.3 kB
HTML
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Custom Properties - Izmir</title>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="assets/css/just-the-docs.css">
<link rel="stylesheet" href="assets/css/izmir.css">
<link rel="stylesheet" href="assets/css/docs.css">
<link rel="stylesheet" href="assets/css/fontawesome.min.css">
<link rel="stylesheet" href="assets/css/fa-solid.min.css">
<script src="assets/js/vendor/lunr.min.js"></script>
<script src="assets/js/just-the-docs.js"></script>
<!-- Begin Jekyll SEO tag v2.6.1 -->
<meta name="generator" content="Jekyll v3.8.6" />
<meta property="og:title" content="Custom Properties" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="ImageHover CSS Library" />
<meta property="og:description" content="ImageHover CSS Library" />
<link rel="canonical" href="3A-custom-properties.html" />
<meta property="og:url" content="3A-custom-properties.html" />
<meta property="og:site_name" content="Izmir" />
<script type="application/ld+json">
{"@type":"WebPage","headline":"Custom Properties","url":"3A-custom-properties.html","description":"ImageHover CSS Library","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->
</head>
<body>
<div class="page-wrap">
<div class="side-bar">
<a href="getting-started.html" class="site-title fs-6 lh-tight">Izmir<span>ImageHover CSS Library</span></a>
<span class="fs-3"><button class="js-main-nav-trigger navigation-list-toggle btn btn-outline" type="button" data-text-toggle="Hide">Menu</button></span>
<div class="navigation main-nav js-main-nav">
<nav role="navigation" aria-label="Main navigation">
<ul class="navigation-list">
<li class="navigation-list-item">
<a href="demo.html" class="navigation-list-link">Demo</a>
</li>
<li class="navigation-list-item">
<a href="1A-getting-started.html" class="navigation-list-link">Getting Started</a>
</li>
<li class="navigation-list-item">
<a href="2A-customisation.html" class="navigation-list-link">Customisation</a>
<ul class="navigation-list-child-list ">
<li class="navigation-list-item ">
<a href="2B-border-animation.html" class="navigation-list-link">Border Animation</a>
</li>
<li class="navigation-list-item ">
<a href="2C-image-animation.html" class="navigation-list-link">Image Animation</a>
</li>
<li class="navigation-list-item ">
<a href="2D-text-animation.html" class="navigation-list-link">Text Animation</a>
</li>
<li class="navigation-list-item ">
<a href="2E-overlay-style.html" class="navigation-list-link">Overlay Style</a>
</li>
<li class="navigation-list-item ">
<a href="2G-caption-layout.html" class="navigation-list-link">Caption Layout</a>
</li>
<li class="navigation-list-item ">
<a href="2F-animation-delay.html" class="navigation-list-link">Animation Delay</a>
</li>
</ul>
</li>
<li class="navigation-list-item active">
<a href="3A-custom-properties.html" class="navigation-list-link active">Custom Properties</a>
</li>
</ul>
</nav>
<div class="cc-izmir">
<a href="https://codecanyon.net/item/izmir-hover-effects-for-elementor/24704473">
<h3>Get Izmir for Elementor</h3>
<p>Add these hover effects to Wordpress using Elementor!</p>
<img src="assets/images/izmir-elementor.jpg" alt="Sample Image">
</a>
</div>
</div>
</div>
<div class="main-content-wrap js-main-content" tabindex="0">
<div class="page-header">
<div class="main-content">
<div class="search js-search">
<div class="search-input-wrap">
<input type="text" class="js-search-input search-input" tabindex="0" placeholder="Search Izmir" aria-label="Search Izmir" autocomplete="off">
<svg width="14" height="14" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg" class="search-icon">
<title>Search</title>
<g fill-rule="nonzero">
<path d="M17.332 20.735c-5.537 0-10-4.6-10-10.247 0-5.646 4.463-10.247 10-10.247 5.536 0 10 4.601 10 10.247s-4.464 10.247-10 10.247zm0-4c3.3 0 6-2.783 6-6.247 0-3.463-2.7-6.247-6-6.247s-6 2.784-6 6.247c0 3.464 2.7 6.247 6 6.247z" />
<path d="M11.672 13.791L.192 25.271 3.02 28.1 14.5 16.62z" />
</g>
</svg>
</div>
<div class="js-search-results search-results-wrap"></div>
</div>
</div>
</div>
<div class="main-content">
<div id="main-content" class="page-content" role="main">
<h2 id="defining-custom-properties">Defining Custom Properties</h2>
<p>Key variables of the CSS library can be set using <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/--*">Custom Properties</a> either globally or inline within a single or selected number of elements.</p>
<h4 id="defining-custom-properties-globally">Defining custom properties globally</h4>
<p>The following example shows how custom properties can be defined globally across your project. Ensure that such CSS is loaded after the library CSS.</p>
<div class="language-css highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nc">.c4-izmir</span> <span class="p">{</span>
<span class="py">--primary-color</span><span class="p">:</span> <span class="m">#F6CD14</span><span class="p">;</span>
<span class="py">--secondary-color</span><span class="p">:</span> <span class="m">#D0206E</span><span class="p">;</span>
<span class="py">--transition-duration</span><span class="p">:</span> <span class="m">500ms</span><span class="p">;</span>
<span class="py">--border-width</span><span class="p">:</span> <span class="m">6px</span><span class="p">;</span>
<span class="py">--overlay-opacity</span><span class="p">:</span> <span class="m">.5</span><span class="p">;</span>
<span class="p">}</span>
</code></pre></div></div>
<h4 id="defining-custom-properties-inline">Defining custom properties inline</h4>
<p>This example shows how custom properties can be defined inline within a single element. These can be defined inline within the <code class="highlighter-rouge"><figure</code> or to a containing div if you wish to define properties to a group elements.</p>
<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt"><figure</span> <span class="na">class=</span><span class="s">"c4-izmir c4-border-center c4-gradient-top-left"</span> <span class="na">style=</span><span class="s">"--primary-color: #000046; --secondary-color: #1CB5E0; --border-width: 10px;"</span><span class="nt">></span>
<span class="nt"><img</span> <span class="na">src=</span><span class="s">"https://source.unsplash.com/1t8go-nyVyE/400x300"</span> <span class="na">alt=</span><span class="s">"Sample Image"</span><span class="nt">></span>
<span class="nt"><figcaption></span>
<span class="nt"><h3></span>
Sample Text
<span class="nt"></h3></span>
<span class="nt"></figcaption></span>
<span class="nt"></figure></span>
</code></pre></div></div>
<figure class="c4-izmir c4-border-center c4-gradient-top-left" style="--primary-color: #000046; --secondary-color: #1CB5E0; --border-width: 10px;">
<img src="https://source.unsplash.com/1t8go-nyVyE/400x300" alt="Sample Image" />
<figcaption>
<h3>
Sample Text
</h3>
</figcaption>
</figure>
<h2 id="text-color">–text-color</h2>
<ul>
<li>Type: <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/color">Color</a></li>
<li>Default: <code class="highlighter-rouge">#ffffff</code></li>
</ul>
<p>Defines the text color within the <code class="highlighter-rouge">figcaption</code> area.</p>
<h2 id="primary-color">–primary-color</h2>
<ul>
<li>Type: <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/color">Color</a></li>
<li>Default: <code class="highlighter-rouge">#00B4DB</code></li>
</ul>
<p>Defines the primary color as used on the hover image overlay.</p>
<h2 id="secondary-color">–secondary-color</h2>
<ul>
<li>Type: <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/color">Color</a></li>
<li>Default: <code class="highlighter-rouge">#0083B0</code></li>
</ul>
<p>Defines the secondary color as used as the to value on overlay gradients.</p>
<h2 id="padding">–padding</h2>
<ul>
<li>Type: <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/length">Length</a></li>
<li>Default: <code class="highlighter-rouge">1em</code></li>
</ul>
<p>Defines the padding of the <code class="highlighter-rouge">figcaption</code> area.</p>
<h2 id="border-radius">–border-radius</h2>
<ul>
<li>Type: <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/length">Length</a></li>
<li>Default: <code class="highlighter-rouge">3px</code></li>
</ul>
<p>Defines the outside border radius of the image.</p>
<h2 id="transition-duration">–transition-duration</h2>
<ul>
<li>Type: <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/time">Time</a></li>
<li>Default: <code class="highlighter-rouge">600ms</code></li>
</ul>
<p>Defines the duration of the animation on hover.</p>
<h2 id="border-margin">–border-margin</h2>
<ul>
<li>Type: <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/length">Length</a></li>
<li>Default: <code class="highlighter-rouge">15px</code></li>
</ul>
<p>Defines the distance between the animated border on hover and the outside edge of the element.</p>
<h2 id="border-width">–border-width</h2>
<ul>
<li>Type: <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/length">Length</a></li>
<li>Default: <code class="highlighter-rouge">3px</code></li>
</ul>
<p>Defines the width (thickness) of the animated border on hover.</p>
<h2 id="border-color">–border-color</h2>
<ul>
<li>Type: <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/color">Color</a></li>
<li>Default: <code class="highlighter-rouge">#ffffff</code></li>
</ul>
<p>Defines the color of the animated border on hover.</p>
<h2 id="image-opacity">–image-opacity</h2>
<ul>
<li>Type: <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/number">Number</a></li>
<li>Default: <code class="highlighter-rouge">.25</code></li>
</ul>
<p>Defines the opacity of the image on hover.</p>
</div>
</div>
</div>
</div>
</body>
</html>