Skip to content

Commit c7a9c44

Browse files
committed
Compile with Dart Sass and fix deprecated slash as division
Resolves #109
1 parent b75722f commit c7a9c44

File tree

4 files changed

+26
-21
lines changed

4 files changed

+26
-21
lines changed

CHANGELOG.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [2.0.3] - 2021-12-02
10+
### Fixed
11+
- Deprecated slash as division when using Dart Sass (issue [#109])
12+
913
## [2.0.2] - 2021-09-01
1014
### Changed
11-
- Set package type to `module` to better support native ES module imports.
12-
- Code cleanup and documentation improvements.
15+
- Set package type to `module` to better support native ES module imports
16+
- Code cleanup and documentation improvements
1317

1418
## [2.0.1] - 2018-05-14
1519
### Added
@@ -217,7 +221,8 @@ Note that the Ladda jQuery API is deprecated - it is recommended to use the plai
217221
## [0.1.0] - 2013-06-05
218222
- Initial release
219223

220-
[Unreleased]: https://github.com/hakimel/Ladda/compare/2.0.2...HEAD
224+
[Unreleased]: https://github.com/hakimel/Ladda/compare/2.0.3...HEAD
225+
[2.0.3]: https://github.com/hakimel/Ladda/compare/2.0.2...2.0.3
221226
[2.0.2]: https://github.com/hakimel/Ladda/compare/2.0.1...2.0.2
222227
[2.0.1]: https://github.com/hakimel/Ladda/compare/2.0.0...2.0.1
223228
[2.0.0]: https://github.com/hakimel/Ladda/compare/1.0.6...2.0.0
@@ -250,6 +255,7 @@ Note that the Ladda jQuery API is deprecated - it is recommended to use the plai
250255
[0.2.0]: https://github.com/hakimel/Ladda/compare/0.1.0...0.2.0
251256
[0.1.0]: https://github.com/hakimel/Ladda/tree/0.1.0
252257

258+
[#109]: https://github.com/hakimel/Ladda/issues/109
253259
[#81]: https://github.com/hakimel/Ladda/pull/81
254260
[#80]: https://github.com/hakimel/Ladda/issues/80
255261
[#68]: https://github.com/hakimel/Ladda/issues/68

Gruntfile.cjs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
const sass = require('node-sass');
1+
const sass = require('sass');
22

33
module.exports = function (grunt) {
44
'use strict';
55

66
// Project configuration
77
grunt.initConfig({
8-
pkg: grunt.file.readJSON('package.json'),
9-
108
sass: {
119
options: {
1210
implementation: sass,
@@ -45,7 +43,7 @@ module.exports = function (grunt) {
4543
browser: true,
4644
node: true,
4745
},
48-
files: [ 'Gruntfile.js', 'js/ladda.js' ]
46+
files: [ 'Gruntfile.cjs', 'js/ladda.js' ]
4947
},
5048

5149
connect: {
@@ -92,10 +90,9 @@ module.exports = function (grunt) {
9290
grunt.loadNpmTasks('grunt-contrib-copy');
9391

9492
// Default task
95-
grunt.registerTask('default', ['js', 'css']);
93+
grunt.registerTask('default', ['jshint', 'css']);
9694

9795
// Theme task
98-
grunt.registerTask('js', ['jshint']);
9996
grunt.registerTask('css', ['sass', 'copy']);
10097

10198
// Serve presentation locally

css/ladda.scss

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
* CONFIG
1212
*/
1313

14+
@use "sass:math";
15+
1416
$spinnerSize: 32px !default;
1517

1618

@@ -113,12 +115,12 @@ $spinnerSize: 32px !default;
113115

114116
.ladda-button[data-style=expand-right] {
115117
.ladda-spinner {
116-
right: $spinnerSize/-2 + 10;
118+
right: math.div($spinnerSize, -2) + 10;
117119
}
118120

119121
&[data-size="s"] .ladda-spinner,
120122
&[data-size="xs"] .ladda-spinner {
121-
right: $spinnerSize/-2 + 4;
123+
right: math.div($spinnerSize, -2) + 4;
122124
}
123125

124126
&[data-loading] {
@@ -142,7 +144,7 @@ $spinnerSize: 32px !default;
142144

143145
.ladda-button[data-style=expand-left] {
144146
.ladda-spinner {
145-
left: $spinnerSize/2 + 10;
147+
left: $spinnerSize * 0.5 + 10;
146148
}
147149

148150
&[data-size="s"] .ladda-spinner,
@@ -183,7 +185,7 @@ $spinnerSize: 32px !default;
183185

184186
.ladda-spinner {
185187
opacity: 1;
186-
top: ($spinnerSize/ 2) + 10;
188+
top: ($spinnerSize * 0.5) + 10;
187189
margin-top: 0;
188190
}
189191

@@ -274,7 +276,7 @@ $spinnerSize: 32px !default;
274276
.ladda-spinner {
275277
right: 100%;
276278
margin-left: 0;
277-
left: $spinnerSize/2;
279+
left: $spinnerSize * 0.5;
278280

279281
[dir="rtl"] & {
280282
right: auto;
@@ -402,7 +404,7 @@ $spinnerSize: 32px !default;
402404

403405
.ladda-spinner {
404406
left: 50%;
405-
margin-left: $spinnerSize/-2;
407+
margin-left: math.div($spinnerSize, -2);
406408
transform: scale(0.2);
407409
}
408410

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ladda",
3-
"version": "2.0.2",
3+
"version": "2.0.3",
44
"description": "Buttons with built-in loading indicators",
55
"homepage": "https://lab.hakim.se/ladda/",
66
"files": [
@@ -29,12 +29,12 @@
2929
"grunt": "^1.4.1",
3030
"grunt-contrib-connect": "^3.0.0",
3131
"grunt-contrib-copy": "^1.0.0",
32-
"grunt-contrib-jshint": "^3.0.0",
32+
"grunt-contrib-jshint": "^3.1.1",
3333
"grunt-contrib-watch": "^1.1.0",
34-
"grunt-sass": "^3.0.2",
35-
"node-sass": "^6.0.1",
36-
"rollup": "^2.56.3",
37-
"rollup-plugin-node-resolve": "^5.2.0"
34+
"grunt-sass": "^3.1.0",
35+
"rollup": "^2.60.2",
36+
"rollup-plugin-node-resolve": "^5.2.0",
37+
"sass": "^1.44.0"
3838
},
3939
"license": "MIT",
4040
"dependencies": {

0 commit comments

Comments
 (0)