Git Product home page Git Product logo

romainmenke-css-import-tests's Introduction

CSS Import tests

@import in used as a signal by build tools to bundle CSS.
It is however important in my opinion that this is done in ways that match native browser behavior.

Without this parallel users of such tools become dependent on the tool itself, and the tool becomes a barrier to entry for new users.

When implementations differ between browsers and tools there is an increased chance that implementations will differ between multiple tools as well. This also blurs the line between feature and bug.

These tests are intended to surface such differences.

Currently this checks :

  • Firefox (a.k.a. native)
  • @csstools/postcss-bundle (in progress tool)
  • postcss-import
  • lightningcss
  • esbuild

Current state :

Test native @csstools/postcss-bundle postcss-import lightningcss esbuild
001/absolute-url
001/default
001/relative-url
at-charset/001
at-keyframes/001
at-layer/001
at-layer/002
at-layer/003
at-layer/004
at-layer/005
at-layer/006
at-layer/007
at-layer/008
at-media/001/absolute-url
at-media/001/default
at-media/002
at-media/003
at-media/004
at-media/005
at-media/006
at-media/007
at-media/008
at-media/009
at-media/010
at-media/011
at-supports/001
at-supports/002
at-supports/003
at-supports/004
at-supports/005
cycles/001
cycles/002
cycles/003
cycles/004
cycles/005
cycles/006
cycles/007
cycles/008
data-urls/001
data-urls/002
data-urls/003
data-urls/004
data-urls/005
data-urls/006
duplicates/001
duplicates/002
empty/001
relative-paths/001
relative-paths/002
subresource/001
subresource/002
subresource/003
subresource/004
subresource/005
subresource/006
subresource/007
url-format/001/absolute-url
url-format/001/default
url-format/001/relative-url
url-format/002/absolute-url
url-format/002/default
url-format/002/relative-url
url-format/003/absolute-url
url-format/003/default
url-format/003/relative-url
url-fragments/001
url-fragments/002

Types of failures

As far as I can tell no one is actually using import conditions and actually checking that the resulting behavior is correct. If anyone had checked any basic case against a browser they would have files issues in upstream projects.

causes of interop issues :

  • bundlers want to optimize for file size
  • bundlers want to support importing CSS from npm packages
  • cascade layers were added to CSS

Contributing

Any test contributions are welcome!

You can open an issue and describe the case you want to test, or you can open a PR with a new test.

I don't care about technical purity, formatting, duplicates, ...
Anything that increases test coverage is very much appreciated.

romainmenke-css-import-tests's People

Contributors

romainmenke avatar

Watchers

 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.