Giter Site home page Giter Site logo

octod / native-elements Goto Github PK

View Code? Open in Web Editor NEW

This project forked from makhbeth/native-elements

4.0 2.0 0.0 1.92 MB

Native HTML Elements with CSS superpowers. ๐Ÿ•ถ

Home Page: https://native-elements.stackblitz.io/

License: Apache License 2.0

JavaScript 36.55% CSS 63.45%

native-elements's Introduction

Google ChromeFirefoxSafariEdge

Native Elements - Demo 1 - Demo 2 - Demo 3

๐Ÿšง Work in progress

This project is under development, use at your own risk.

Install

Install the package with your package manager:

yarn add @native-elements/core

Installation

To enable your HTML superpowers, import the main, bundled CSS file in your project:

With a bundler

import '@native-elements/core'

Inside HTML

<link rel="preconnect" href="https://cdn.jsdelivr.net">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@native-elements/core/dist/native-elements.min.css">

Customize elements

Currently we provide a basic theme with all the custom properties used by the handled elements. To customize things, copy the theme file to your application :root {} selector, and change the variables you want.

:root {
  /* Custom palette */
  --accent-color: hotpink;
  --secondary-color: rebeccapurple;

  /* Native Elements settings */
  --ne-hr-background: var(--secondary-color);
  --ne-links-foreground: var(--accent-color);
}

Check the full theme file

โš ๏ธ NOTE: The --accent-color property has been added to the theme just to simplify the accent color customization. By default elements don't use this property

About outline

Native Elements adds by default the outline indicator to any link elements when they are on :focus state.

Since the outline is useful for the keyboard navigation, you should never completely hide it. We strongly suggest to control when to hide the outline, for example using what-input you can do this by including it in your JavaScript file, then add this CSS snippet:

[data-whatintent='mouse'] a:focus,
[data-whatintent='mouse'] a:visited:focus {
  outline: none;
}

By this way the outline indicator will be visible only when the users is using the keyboard as input to navigate through the page.

native-elements's People

Contributors

d2s avatar dependabot-preview[bot] avatar dependabot[bot] avatar equinusocio avatar greenkeeper[bot] avatar lasalefamine avatar makhbeth avatar octod avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.