# ansky

> Ansky te permite interpretar el codigo css y usarlo en js

Latest version **0.0.2** (published 2024-04-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install ansky
pnpm add ansky
yarn add ansky
bun add ansky
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2024-04-10 |
| First published | 2024-04-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Neko Shooter |
| Maintainers | neko_shooter |
| Keywords | css, Front-End, stylesheet, style, dom, vanilla js |

## Links

- npm: https://www.npmjs.com/package/ansky
- Repository: https://github.com/NekoShooter/Ansky
- Issues: https://github.com/NekoShooter/Ansky/issues
- npm.io page: https://npm.io/package/ansky

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2024-04-10
- 0.0.1 — 2024-04-10

## README

<h1 align="center">✨ Ansky ✨</h1>
<p align="center">
<a href="#"><img src="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExY2FoMWVxcm1sMzVtNzEzbGd4b3hpaWFzZjBrdGJsOGJ1OWd5dmludCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/qU7jYnrVUyeJiz0te9/source.gif" alt="github.gif" border="0"></a>
<p/>
<br/>

###### *Instalación:*

``` bash
npm install ansky
```
### ¿Qué hace Ansky?
Ansky permite leer la sintaxis de CSS para inyectarlo de forma directa a los objetos **HTMLElement** para tener una forma más legible de leer el código.

``` javascript
const div1 = document.createElement("div");
const div2 = document.createElement("div");
document.body.appendChild(div1);
document.body.appendChild(div2);

ansky([div1,div2],`
    width:50px; 
    height:50px;
    border: 1px solid`);

ansky(div1,`
    background-color: blue;
    border-color:red;
`);

ansky(div2,`
    background-color: red;
    border-color: blue;`);
```
## Detalles

``` javascript
ansky(objHTML, css);
```
 * **`objHTML`** : El elemento HTML o Array de elementos HTML al que se aplicarán los estilos.
 * **`css`** : Una cadena de texto que contiene los estilos en la sintaxis clásica de _`CSS`_.  
<br/>

## Limpiar Estilos

Si decide usar **`ansky`** para eliminar algunos estilos, puede hacerlo no declarando la propiedad del estilo.  
###### _ejemplo:_
``` javascript
    ansky(div,`
        padding:;
        border:;
    `);
```
> _el punto y coma `;` es importante_

<br/>

 ## Recomendaciones y sugerencias

 + Los estilos propios y exclusivos de los navegadores podrían ser omitidos.
 + Puede construir sus `string` con código CSS usando acentos graves ( \` ) para una lectura más amena.

 + Ansky fue pensada únicamente para el front-end, por lo que debería considerar un empaquetador como `webpack` o extraer Ansky.js y usarla directamente.

---
_Source: https://npm.io/package/ansky · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
