Skip to content

Commit

Permalink
Merge pull request #3 from marqueefy/feature
Browse files Browse the repository at this point in the history
Add data attributes to the HTML if options are passed via javascript
  • Loading branch information
nkdas91 authored Nov 18, 2022
2 parents a0a193d + b63117e commit 882dbc6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .bundlewatch.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
},
{
"path": "./dist/js/marqueefy.esm.js",
"maxSize": "2.30 kB"
"maxSize": "2.35 kB"
},
{
"path": "./dist/js/marqueefy.esm.min.js",
"maxSize": "1.65 kB"
"maxSize": "1.7 kB"
},
{
"path": "./dist/js/marqueefy.js",
"maxSize": "2.5 kB"
},
{
"path": "./dist/js/marqueefy.min.js",
"maxSize": "1.66 kB"
"maxSize": "1.7 kB"
}
],
"ci": {
Expand Down
3 changes: 3 additions & 0 deletions js/src/marqueefy.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ class Marqueefy extends BaseComponent {
const { direction } = this._config
const { speed } = this._config

this._element.setAttribute('data-mq-direction', direction)
this._element.setAttribute('data-mq-speed', speed)

const content = this._element.querySelector('.content')
let distance = content.getBoundingClientRect().width

Expand Down
2 changes: 1 addition & 1 deletion site/assets/1.0/scss/site.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}

&[data-color="orange"] {
--theme-primary: 202,101,16;
--theme-primary: 202, 101, 16;
}
}

Expand Down

0 comments on commit 882dbc6

Please sign in to comment.