Comments (5)
Ahh, just did some testing on this. You can set default values before defining the function or mixin like we had before, but the problem you found was an error in the example sass file. The were setting new !default values, but were being ignored. The solution is to just set a new value to the variable. Like so:
_modular-scale.sass
$ratio: $golden !default
$base-size: 12px !default
$property: font-size !default
$class-slug: ms !default
// Modular Scale function
@function modular-scale($multiple, $base-size, $ratio)
example.sass
.foo
width: modular-scale(2)
// $base-size value is 12px
$base-size: 14px
.bar
width: modular-scale(2)
// $base-size value is 14px
$base-size: 16px !default
.baz
width: modular-scale(2)
// $base-size value is 14px
This solves the problem. I'll push the code for this today.
from modularscale-sass.
pushed some code:
- add default values back. fix the redeclared defaults in the test sass file
- organize the example sass file
- removing the duplicate test html and css. Went with the server version because I find it useful, and because that's the way the config.rb file was set up
from modularscale-sass.
nice, why use .html.erb though?
from modularscale-sass.
mostly because it was working with Serve. I think its moderately helpful while developing. not a dealbreaker for me if you feel like simplifying that tho.
from modularscale-sass.
ah, that makes sense. We can leave it as-is for now but in the long run I would like everything as bare-bones simple as possible.
from modularscale-sass.
Related Issues (20)
- Combine breakpoints with threads HOT 3
- Implement a way to disable viewport-based typography in version 3 ($ms-fluid: false) HOT 1
- Disable px rounding option HOT 3
- Output calculation as rem value HOT 2
- Both regular and non-conflict ms functions are returning raw output HOT 6
- Removal of ms-round-px causes build failure HOT 7
- SyntaxError on @import HOT 6
- Eyeglass v2.0.0 support HOT 3
- Deprecation warning HOT 1
- Not working for REM on media query HOT 5
- Can't make ms-respond to work HOT 6
- www.-less links to modularscale.com not redirecting
- No mixin named ms-respond HOT 2
- Eyeglass v3 support
- modularscale.com & www.modularscale.com are redirecting to separate websites HOT 3
- Deprecation warnings after upgrading Sass when using `ms` Variable HOT 21
- Changes to responsive logic HOT 2
- On CSS locks and `clamp()` HOT 6
- 4.x - Importing modular scale using ratio string results in an error
- A lite dart-sass implementation, and proposal for contribution HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modularscale-sass.