Socket
Book a DemoInstallSign in
Socket

@ewc-lib/ewc-banner

Package Overview
Dependencies
Maintainers
0
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ewc-lib/ewc-banner

![Screenshot](./screenshot.png)

npmnpm
Version
2.0.2-alpha
Version published
Weekly downloads
12
20%
Maintainers
0
Weekly downloads
 
Created
Source

Screenshot

Screenshot

API

There are the following attributes:

  • maintitle - sets the headline text
  • subtitle - sets the subtitle text

Note: All attributes have an effect when changed at runtime.

Customisations

Ribbon hiding

The ribbon hiding can be customised (by disabling the default and specifying it again) in the following way:

<style>
  @media (max-width: 1200px) {
    .ewc-banner__ribbon { display: revert; }
  }
  @media (max-width: 900px) {
    .ewc-banner__ribbon { display: none; }
  }
</style>

Logo hiding

<style> .ewc-banner__logo {visibility: hidden;} </style>

Height

The default height is 128px and can be modified like this:

<style>
  .ewc-banner__container {height:80px;}
  .ewc-banner__ribbon {height:80px;}
</style>

Gradient style

There are 3 styles predefined (--gradient-version-1 to --gradient-version-3).

It can be selected like this:

<ewc-banner 
  style="--gradient-selection: var(--gradient-version-1);">
</ewc-banner>

Usage with WebPack

package.json

"dependencies": {
  "@ewc-lib/ewc-banner": "^1.0.0"
}

webpack.config.js

...

module: {
  rules: [
    {
      test: /\.css$/i,
      use: [
        'style-loader',
        'css-loader'
      ]
    }
  ]
}

...

index.html

<!DOCTYPE html>
<html>

  <head>
    <style>
      body{
          font-family: 'Arial', sans-serif;
          margin: 0;
        }
    </style>
  </head>

  <body>
      <script src="bundle.js"></script>

      <!-- example for overwriting the ribbon hiding. it's not mandatory -->
      <style>
        @media (max-width: 1200px) {
          .ewc-banner__ribbon {
              display: revert;
          }
        }
        @media (max-width: 900px) {
          .ewc-banner__ribbon {
              display: none;
          }
        }
      </style>
      <ewc-banner mainTitle="Demonstration of a title in a banner" subTitle="Demonstration of a subtitle"></ewc-banner>
  </body>

</html>

index.js

import "@ewc-lib/ewc-css/ewc.css"
import "@ewc-lib/ewc-banner"

FAQs

Package last updated on 27 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts