0.2.27 • Published 2 years ago

@shawnsandy/modals v0.2.27

Weekly downloads
20
License
MIT
Repository
-
Last release
2 years ago

Modals

Simple zero dependency CSS powered Modals

Install

npm i @shawnsandy/modals

Add your modals to the page

<div id="modal" class="cs-overlay">
    <a href="#" class="cancel"></a>
    <div class="cs-modal cs-modal-sm">
        <p>
            Lorem ipsum dolor sit amet consectetur adipisicing elit. Odit hic, excepturi consequatur deleniti totam quidem
            aliquid perferendis iste molestias delectus asperiores. Minus voluptates consequuntur porro necessitatibus quod
            illo voluptas quis!
        </p>
        <a href="#" class="cs-close">
            <span id="cs-close">&times;</span>
        </a>
    </div>
</div>

Add your links to trigger the modals

<p>
    <a href="#modal" class="">Open Modal</a>
</p>

Add button onclick to trigger the modals

<p>
    <button type="button" onclick="location.hash='modal'" class="js-modal-css" type="button">Open Modal
    </button>
</p>

Link to the js script

  <button type="button" class="js-modal-css" data-target="#modal" type="button">Open Modal
  </button>
<script src="/modals/script.js"></script>

Add CSS to you page

<link src="/modals/styles.css">

Import and customize SCSS

// change the default colors/attributes
$overlay-bg: rgba(0, 0, 0, 0.8) !default;
$modal-bg: white !default;
$modal-shadow: 0 5px 11px rgba(36, 37, 38, 0.08) !default;

@import "node_modules/@shawnsandy/modals/src/scss"

Licence MIT

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0.2.27

2 years ago

0.2.24

2 years ago

0.2.23

2 years ago

0.2.20

3 years ago

0.2.19

3 years ago

0.2.18

3 years ago

0.2.17

3 years ago

0.2.16

3 years ago

0.2.15

3 years ago

0.2.14

3 years ago

0.2.13

3 years ago

0.2.12

3 years ago

0.2.7

4 years ago

0.2.6

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.1.11

5 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago