New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

agnos

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

agnos

An utility library that intends to applies any popular UI framework to standard html markup

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

There is a large number of UI frameworks that can be used for web app development. Without too much effort, You can add UI elements by just incorporate the the markup language provided by any of those frameworks. The markup is however framework specific, and causes a vendor lock-in.

Concept

The example below shows the differences between the usage of a large colorful button in bootstrap and Bulma.

<button class="btn btn-primary btn-lg">botstrap button</button>
<button class="button is-primary is-large">bulma button</button>

In order to be able to move from one UI framework to another, we introduce a clean and standard markup for the html (we're not religious about this markup, but we aim to be as close to html5 standard as we can).

<button class="large">agnos button</button>

In our scss file, we're using the agnos to transform the underlying UI framework to our UI.

There are couple of other related concerns that are related to this work:

  • (web) components have an encapsulated view and therefor require smaller (dedicated) pieces of CSS. Agnos should be able to provide access to a small portion of the UI library only.
  • similar to CSS, icons are another candidate to be replaced. This can be done in the same spirit, but requires another technique.
  • variables (i.e. colors) are framework specific as well, we're considering to make those more generic (and move to css variables while we do that)
  • similar to icons and variables, the font settings should be configurable in a generic way. We haven't deep dived here, but this seems straightforward for now.

Getting started

Agnus has not yet been published to npm. In order to experiment with this framework, you can clone the project and use it by adding the following lines to your application scss file:

@import '../../agnos/scss/bulma';
@include _bootstrap($button: true, $tabs: true);

(this example will extend bulma, but only the button and tabs).

Coverage

This library just got started, so only a few components have been transformed. The implementation is intended to be extendable, but in order to 'proof' the concept, the following UI frameworks are used:

  • Bootstrap
  • Materialize
  • Foundation sites
  • Bulma
  • Fundamental UI
FeatureBootstrapMaterializeBulmaFoundationFundamental UI
Typography
Button
Tabs✅ ¹
AlertN/A

¹ Feature is incomplete as it requires JS

Limitations

This project only tries to fix the CSS part of the UI. Any interaction that requires JS are out of scope (which btw causes another dependency lock-in).

The key technique that used in agnos relies on inheritance, a key concept form the sass language. Using sass @extend obviously requires the UI framework to support sass in the first place (but most of them seem to do that). Ideally, UI frameworks would offer placeholder selectors to extend from,instead of concrete selectors. This would decrease the CSS output. Without placeholder selectors, the output is more poluted then anyone would like.

Keywords

FAQs

Package last updated on 04 Oct 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc