Giter VIP home page Giter VIP logo

Comments (21)

spenno avatar spenno commented on June 14, 2024 3

@joyheron: The same thing happened to me yesterday. Until this is updated, I have copied the stylesheets/_modularscale.scss Sass file and the stylesheets/modularscale folder into a vendors folder in my local source files and imported that version of the Sass file instead of the one in node_modules.

Then I updated the math divisions in three of the Sass partials to use Sass 1.33's new maths.div function.

You can see the changes I made here: https://github.com/modularscale/modularscale-sass/compare/3.x...spenno:feature/math-division?expand=1

And a quick summary of the changes made:

_functions.scss line 29: $ms-base: math.div($ms-base, $ratio);
_pow.scss line 35: $ms-return: math.div($ms-return, $b);
_strip-units.scss line 6: @return (math.div($val, ($val - $val + 1)));

I would submit a pull request for this @scottkellum, but it would completely break for people still using LibSass. Although LibSass is now deprecated, I'm guessing you would prefer a more elegant transition than that :)

from modularscale-sass.

scottkellum avatar scottkellum commented on June 14, 2024 2

@spenno Breaking changes are what Semantic Versioning and dependency lists are for. I may go ahead and do a major version bump.

Now that exponents are now native to the Sass that will simplify a ton of code. Might as well do a big re-write.

Note that I’ll likely make some changes to ms-respond in the process. Changes there may be breaking with that mixin, but I’ll try to avoid it. There have been a lot of advancements here and plenty of better ways to implement responsive typography.

from modularscale-sass.

gvjacob avatar gvjacob commented on June 14, 2024 2

Sharing a fairly low-effort workaround that works well for me. Install sass-migrator and put the following script in your package.json

"postinstall": "sass-migrator division node_modules/modularscale-sass/stylesheets/modularscale/*.scss"

On every npm install, the script will convert any / divisions to math.div in the plugin's output files. Some context to sass-migrator here

from modularscale-sass.

scottkellum avatar scottkellum commented on June 14, 2024 1

New release you can test out here: https://github.com/modularscale/modularscale-sass/releases/tag/v4.0.0.rc1

from modularscale-sass.

robsonsobral avatar robsonsobral commented on June 14, 2024 1

@scottkellum , hi!

I'm sorry, but I didn't get the expose of the ms.$settings map. Why not to use with() and make the settings private?

@use '../vendor/modularscale' with (
  $settings: (base: 1rem, ratio: 1.25),
);

@forward '../vendor/modularscale';

It can be "imported" once and forwarded already configured.

from modularscale-sass.

robsonsobral avatar robsonsobral commented on June 14, 2024 1

https://sass-lang.com/documentation/at-rules/forward#configuring-modules

from modularscale-sass.

scottkellum avatar scottkellum commented on June 14, 2024 1

@robsonsobral I understand but I am also really busy. I would love a PR here if anyone has the time and is interested in contributing.

If you do contribute please keep any configuration and dependencies to a minimum.

If no one can help I may release next week without tests.

from modularscale-sass.

scottkellum avatar scottkellum commented on June 14, 2024 1

To clarify, @ everyone reading this.

I am looking for help to write tests and ensure distribution channels are solid before release.

from modularscale-sass.

robsonsobral avatar robsonsobral commented on June 14, 2024 1

This lib/addon/plugin/toolkit/whatever has been a constant part of my work for years. So, I gonna to give it back to the community.

from modularscale-sass.

scottkellum avatar scottkellum commented on June 14, 2024

Thank you. I have not updated in a while and Sass functionality as well as CSS has come a long way over the years. It may be about time for a re-write to take advantage of the new Sass module system. My main focus has been another typography tool, Typetura, and it's been a while since I've done modular scale stuff.

from modularscale-sass.

joyheron avatar joyheron commented on June 14, 2024

Thank you for looking into this!

from modularscale-sass.

strarsis avatar strarsis commented on June 14, 2024

Related to exponents in sass: #113

from modularscale-sass.

scottkellum avatar scottkellum commented on June 14, 2024

Status update: The thing holding this up now is the responsive logic

from modularscale-sass.

strarsis avatar strarsis commented on June 14, 2024

Does it make sense to prepare it for the upcoming CSS Container Queries?

from modularscale-sass.

scottkellum avatar scottkellum commented on June 14, 2024

@strarsis Yes, part of the reason why I want to update it to output Typetura styles instead of locks/clamp as an option. It would be easier with post-processing stylesheets as opposed to pre-processing as you have to be more explicit in pre-processing. Use cases like #148 are difficult to build a nice syntax around.

from modularscale-sass.

scottkellum avatar scottkellum commented on June 14, 2024

I got things working and the syntax is going to be something like this:

@include ms.step using ($respond) {
  foo {
    // This will be responsive
    bar: ms.step(2, $settings: $respond);

    // If for some reason you don’t want something to be responsive in these blocks, you can do this
    baz: ms.step(2)
    
    // Shorthand will work here! And you can mix responsive and non-responsive values.
    padding: ms.step(2, $settings: $respond) ms.step(1)

  }
}

I do not think I will support clamp() or locks. It will either be media queries, container queries, or Typetura.

Related to issue #148

from modularscale-sass.

scottkellum avatar scottkellum commented on June 14, 2024

@robsonsobral thanks Rob, I will definitely look into this approach. I do like the ability to change the settings throughout your style sheet as needed, so I might want to make this work with that functionality.

from modularscale-sass.

scottkellum avatar scottkellum commented on June 14, 2024

Thanks for your feedback @robsonsobral, I drafted a new release here: https://github.com/modularscale/modularscale-sass/releases/tag/v4.0.0.rc2

from modularscale-sass.

robsonsobral avatar robsonsobral commented on June 14, 2024

@scottkellum , I've been really busy, but I would like to do some tests before the release, if you don't mind.

from modularscale-sass.

joyheron avatar joyheron commented on June 14, 2024

@scottkellum Thank you for your work on this!

I have been testing out the new 4.x implementation, and for the most part it seems to work (I made an Issue for the only error that I have: #176 )

One things that I noticed is that the migration from 3.x to 4.x is a bit tricky because a CSS rule like width: ms(2) (which needs to be replaced with ms.step(2)) isn't recognized as an error by the Sass compiler so the error isn't obvious at compile time (since it isn't valid CSS, the rule is ignored and the layout is just a bit (or a lot) off). But other than that, I was successful in migrating my code.

I am very happy to continue testing in the future.

from modularscale-sass.

heun01 avatar heun01 commented on June 14, 2024

Since nothing has happened here for a long time, can we still expect an update?

from modularscale-sass.

Related Issues (20)

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.