SCSS files for datatables styling?

SCSS files for datatables styling?

jellisiijellisii Posts: 10Questions: 2Answers: 0

I'm using the NPM provided versions of datatables for Zurb Foundation. Sass is complaining about the CSS imports indicating that importing css is being deprecated. Can we get SCSS files in the packages for working with sass?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin

    We use sass to build the scss files in the source repo. Can you tell me what version of sass you are using and also show the error messages please?

    Allan

  • jellisiijellisii Posts: 10Questions: 2Answers: 0

    I'm using gulp-sass 3.2.1, which in turn uses node-sass 4.9.0. I get the datatable files using yarn. I'm getting a fistful of the datatables packages that all come from registry.yarnpkg.com.

    datatables.net-responsive-zf@^2.2.2:
    version "2.2.3"
    datatables.net-responsive@2.2.3:
    version "2.2.3"
    datatables.net-rowreorder-zf@^1.2.4:
    version "1.2.5"
    datatables.net-rowreorder@1.2.5:
    version "1.2.5"
    datatables.net-zf@^1.10.15:
    version "1.10.19"
    datatables.net@1.10.19, datatables.net@^1.10.15:
    version "1.10.19"

    The packages that are fetched don't appear to have the scss files baked in, only including the css files.

    In my sass, I'm just @importing the the css:

    @import "../../node_modules/datatables.net-zf/css/dataTables.foundation";
    @import "../../node_modules/datatables.net-responsive-zf/css/responsive.foundation";
    @import "../../node_modules/datatables.net-rowreorder-zf/css/rowReorder.foundation";
    

    Sass is balking when it hits these:

    Including .css files with @import is non-standard behaviour which will be removed in future versions of LibSass.
    Use a custom importer to maintain this behaviour. Check your implementations documentation on how to create a custom importer.
    

    I could work on the custom importer, but it'd be nice to have the scss files in the package from npm/yarn so I can twiddle with them as I need to on the fly.

    Thank you for your time.

  • jellisiijellisii Posts: 10Questions: 2Answers: 0

    Any word on this, or is it "don't use the packages on registry.yarnpkg.com"?

    Thanks for your time.

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin
    Answer ✓

    Sorry - I completely lost track of this thread. Our distribution repos (datatables.net / datatables.net-bs4 / etc) all include only the compiled source (e.g. JS rather than TS, if that were used and CSS rather than SCSS).

    At the moment what you need to do is get the SCSS files directly from Github. What we should perhaps do is have a datatables.net-src node package that can be used for all the source files.

    Thanks,
    Allan

  • jellisiijellisii Posts: 10Questions: 2Answers: 0

    No worries, you're a busy guy.

    I don't know what the impact of including all the source in the built packages would be (foundation-sites does this very thing including a 'dist' folder that has everything built, and a complete copy of the source that was used to build the contents of the dist folder), but that could be an option.

    If it's unwieldy or onerous to include the source in the main packages, the src packages are a good idea, even though it would require more work. Since I'm already doing some of it already (SCSS/SASS) it's probably to be expected anyway.

    Thanks for the heads up.

  • sadeghbarati5sadeghbarati5 Posts: 19Questions: 2Answers: 0

    @allan

    can you publish DataTablesSrc latest source in NPM ?

    DataTablesSrc github version: 1.11.0

    DataTablesSrc npm version: 1.10.12

  • sadeghbarati5sadeghbarati5 Posts: 19Questions: 2Answers: 0
    edited August 2021

    :smile:

  • allanallan Posts: 61,650Questions: 1Answers: 10,094 Site admin

    Why do you use the DataTablesSrc repo via NPM? It doesn't include the distribution files. They need to be combined using a shell script before they are any use.

    Thanks,
    Allan

  • sadeghbarati5sadeghbarati5 Posts: 19Questions: 2Answers: 0
    edited June 2022

    @allan

    I need scss of each datatables extension when install them with npm ( customization )

    but when install module, only css build is present in node_modules

    I'll create a discussion later for better understanding

Sign In or Register to comment.