I was looking for a SSR and scoped styles ready solution to implement inline SVG with Nuxt
You need svg-inline-loader
and xmldom
to be installed.
/* | |
This is not meant to be a final CSSWG proposal, | |
but reflects my immediate thoughts after reading | |
[David Baron's](https://github.com/dbaron/container-queries-implementability) promising draft. | |
This gist was created to demonstrate my idea for removing selectors from his query syntax. | |
More of my thoughts & notes are online at css.oddbird.net/rwd/ | |
*/ | |
main, |
/** | |
* Will gracefuly scroll the page | |
* This function will scroll the page using | |
* an `ease-in-out` effect. | |
* | |
* You can use it to scroll to a given element, as well. | |
* To do so, pass the element instead of a number as the position. | |
* Optionally, you can pass a `queryString` for an element selector. | |
* | |
* The default duration is half a second (500ms) |
I was looking for a SSR and scoped styles ready solution to implement inline SVG with Nuxt
You need svg-inline-loader
and xmldom
to be installed.
background: #f09433; | |
background: -moz-linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); | |
background: -webkit-linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%); | |
background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%); | |
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f09433', endColorstr='#bc1888',GradientType=1 ); | |
} |
# http://blog.teamtreehouse.com/the-absolute-beginners-guide-to-sass | |
# Enter the folder you want to convert in your terminal and type in: | |
# --------------------------------------------------------------------- | |
# sudo apt get install ruby-sass | |
# --------------------------------------------------------------------- | |
sass-convert --from sass --to scss -R . | |
# where -R means recursively and . means the current directory. |
function trimSvgWhitespace() { | |
// get all SVG objects in the DOM | |
var svgs = document.getElementsByTagName("svg"); | |
// go through each one and add a viewbox that ensures all children are visible | |
for (var i=0, l=svgs.length; i<l; i++) { | |
var svg = svgs[i], | |
box = svg.getBBox(), // <- get the visual boundary required to view all children |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css"> | |
<textarea #simplemde></textarea> |
The issue:
..mobile browsers will wait approximately 300ms from the time that you tap the button to fire the click event. The reason for this is that the browser is waiting to see if you are actually performing a double tap.
(from a new defunct https://developers.google.com/mobile/articles/fast_buttons article)
touch-action
CSS property can be used to disable this behaviour.
touch-action: manipulation
The user agent may consider touches that begin on the element only for the purposes of scrolling and continuous zooming. Any additional behaviors supported by auto are out of scope for this specification.
Looking for support tables for HTML/CSS/JavaScript features or details on their implementation status in major browsers?
And then there’s Can I use…?.