atomiks / tippyjs

Tooltip, popover, dropdown, and menu library
https://atomiks.github.io/tippyjs/
MIT License
12.03k stars 520 forks source link

Use style field in package.json #839

Closed seahindeniz closed 4 years ago

seahindeniz commented 4 years ago

Problem

This is the way to import the CSS file, which is kind of ugly because of the relative path

@import 'tippy.js/dist/tippy.css';

Solution

Using the style field in package.json file like this

{
  "style": "dist/tippy.css",
  ...
  "version": "6.2.6"
}

will allow importing style file in this way

@import "~tippy.js";
atomiks commented 4 years ago

There's a bunch of other CSS files that can be, or need to be, imported as well though, so imo for consistency it should be left as it is.