Skip to content

Include SCSS files in exports #5560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

saltire
Copy link
Contributor

@saltire saltire commented Apr 9, 2025

Description

This PR exposes the source SCSS files via the package's exports so projects can import them.

Problem
This project's SCSS has a lot of useful variables (e.g. $datepicker__selected-color), but no obvious way to change their default values. This way, a project can import the SCSS files with overrides for the variables, instead of setting a bunch of individual attributes. For example:

@use 'react-datepicker/src/stylesheets/variables.scss' with (
  $datepicker__selected-color: #000000,
  $datepicker__font-family: inherit,
);
@use 'react-datepicker/src/stylesheets/datepicker.scss';

If there is a better way of doing this, please let me know!

Changes
Simply add a line to exports in package.json with a wildcard for all SCSS files.

Contribution checklist

  • I have followed the contributing guidelines.
  • I have added sufficient test coverage for my changes.
  • I have formatted my code with Prettier and checked for linting issues with ESLint for code readability.

Copy link

codecov bot commented Apr 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.01%. Comparing base (0a980b3) to head (b69ac4c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5560   +/-   ##
=======================================
  Coverage   97.01%   97.01%           
=======================================
  Files          30       30           
  Lines        3350     3350           
  Branches     1398     1416   +18     
=======================================
  Hits         3250     3250           
+ Misses        100       98    -2     
- Partials        0        2    +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant