mirror of https://github.com/freeCodeCamp/devdocs
commit
40991852dd
@ -1 +1 @@
|
|||||||
2.6.0
|
2.6.3
|
||||||
|
@ -1,2 +1 @@
|
|||||||
public/icons
|
|
||||||
test
|
test
|
@ -1,7 +1,26 @@
|
|||||||
language: ruby
|
language: ruby
|
||||||
|
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- libcurl4-openssl-dev
|
||||||
|
|
||||||
cache: bundler
|
cache: bundler
|
||||||
|
|
||||||
before_script:
|
before_install:
|
||||||
|
- "echo 'gem: --no-document' > ~/.gemrc"
|
||||||
- gem update --system
|
- gem update --system
|
||||||
- gem install bundler
|
- gem install bundler
|
||||||
|
|
||||||
|
script:
|
||||||
|
- if [ "$TRAVIS_EVENT_TYPE" != "cron" ]; then bundle exec rake; fi
|
||||||
|
- if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then bundle exec thor updates:check --github-token $GH_TOKEN --upload; fi
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
provider: heroku
|
||||||
|
app: devdocs
|
||||||
|
on:
|
||||||
|
branch: master
|
||||||
|
condition: $TRAVIS_EVENT_TYPE != cron
|
||||||
|
api_key:
|
||||||
|
secure: "4p1klvWJZSOImzFcKOduILjP93hlOlAhceWlYMKS4tU+TCFE8qTBzdKdFPSCsCgjB+YR9pBss+L0lJpVVMjSwFHXqpKe6EeUSltO2k7DFHfW7kXLUM/L0AfqXz+YXk76XUyZMhvOEbldPfaMaj10e8vgDOQCSHABDyK/4CU+hnI="
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
> Our Code of Conduct is available here: <https://code-of-conduct.freecodecamp.org/>
|
@ -0,0 +1 @@
|
|||||||
|
sprites/**/*
|
Before Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 119 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 48 KiB |
@ -1,42 +0,0 @@
|
|||||||
class app.AppCache
|
|
||||||
$.extend @prototype, Events
|
|
||||||
|
|
||||||
@isEnabled: ->
|
|
||||||
try
|
|
||||||
applicationCache and applicationCache.status isnt applicationCache.UNCACHED
|
|
||||||
catch
|
|
||||||
|
|
||||||
constructor: ->
|
|
||||||
@cache = applicationCache
|
|
||||||
@notifyUpdate = true
|
|
||||||
@onUpdateReady() if @cache.status is @cache.UPDATEREADY
|
|
||||||
|
|
||||||
$.on @cache, 'progress', @onProgress
|
|
||||||
$.on @cache, 'updateready', @onUpdateReady
|
|
||||||
|
|
||||||
update: ->
|
|
||||||
@notifyUpdate = true
|
|
||||||
@notifyProgress = true
|
|
||||||
try @cache.update() catch
|
|
||||||
return
|
|
||||||
|
|
||||||
updateInBackground: ->
|
|
||||||
@notifyUpdate = false
|
|
||||||
@notifyProgress = false
|
|
||||||
try @cache.update() catch
|
|
||||||
return
|
|
||||||
|
|
||||||
reload: ->
|
|
||||||
$.on @cache, 'updateready noupdate error', -> app.reboot()
|
|
||||||
@notifyUpdate = false
|
|
||||||
@notifyProgress = true
|
|
||||||
try @cache.update() catch
|
|
||||||
return
|
|
||||||
|
|
||||||
onProgress: (event) =>
|
|
||||||
@trigger 'progress', event if @notifyProgress
|
|
||||||
return
|
|
||||||
|
|
||||||
onUpdateReady: =>
|
|
||||||
@trigger 'updateready' if @notifyUpdate
|
|
||||||
return
|
|
@ -0,0 +1,49 @@
|
|||||||
|
class app.ServiceWorker
|
||||||
|
$.extend @prototype, Events
|
||||||
|
|
||||||
|
@isEnabled: ->
|
||||||
|
!!navigator.serviceWorker and app.config.service_worker_enabled
|
||||||
|
|
||||||
|
constructor: ->
|
||||||
|
@registration = null
|
||||||
|
@notifyUpdate = true
|
||||||
|
|
||||||
|
navigator.serviceWorker.register(app.config.service_worker_path, {scope: '/'})
|
||||||
|
.then(
|
||||||
|
(registration) => @updateRegistration(registration),
|
||||||
|
(error) -> console.error('Could not register service worker:', error)
|
||||||
|
)
|
||||||
|
|
||||||
|
update: ->
|
||||||
|
return unless @registration
|
||||||
|
@notifyUpdate = true
|
||||||
|
return @registration.update().catch(->)
|
||||||
|
|
||||||
|
updateInBackground: ->
|
||||||
|
return unless @registration
|
||||||
|
@notifyUpdate = false
|
||||||
|
return @registration.update().catch(->)
|
||||||
|
|
||||||
|
reload: ->
|
||||||
|
return @updateInBackground().then(() -> app.reboot())
|
||||||
|
|
||||||
|
updateRegistration: (registration) ->
|
||||||
|
@registration = registration
|
||||||
|
$.on @registration, 'updatefound', @onUpdateFound
|
||||||
|
return
|
||||||
|
|
||||||
|
onUpdateFound: =>
|
||||||
|
$.off @installingRegistration, 'statechange', @onStateChange() if @installingRegistration
|
||||||
|
@installingRegistration = @registration.installing
|
||||||
|
$.on @installingRegistration, 'statechange', @onStateChange
|
||||||
|
return
|
||||||
|
|
||||||
|
onStateChange: =>
|
||||||
|
if @installingRegistration and @installingRegistration.state == 'installed' and navigator.serviceWorker.controller
|
||||||
|
@installingRegistration = null
|
||||||
|
@onUpdateReady()
|
||||||
|
return
|
||||||
|
|
||||||
|
onUpdateReady: ->
|
||||||
|
@trigger 'updateready' if @notifyUpdate
|
||||||
|
return
|
@ -1,4 +1,8 @@
|
|||||||
class @CookieStore
|
class @CookiesStore
|
||||||
|
# Intentionally called CookiesStore instead of CookieStore
|
||||||
|
# Calling it CookieStore causes issues when the Experimental Web Platform features flag is enabled in Chrome
|
||||||
|
# Related issue: https://github.com/freeCodeCamp/devdocs/issues/932
|
||||||
|
|
||||||
INT = /^\d+$/
|
INT = /^\d+$/
|
||||||
|
|
||||||
@onBlocked: ->
|
@onBlocked: ->
|
@ -0,0 +1,64 @@
|
|||||||
|
defaultUrl = null
|
||||||
|
currentSlug = null
|
||||||
|
|
||||||
|
imageCache = {}
|
||||||
|
urlCache = {}
|
||||||
|
|
||||||
|
withImage = (url, action) ->
|
||||||
|
if imageCache[url]
|
||||||
|
action(imageCache[url])
|
||||||
|
else
|
||||||
|
img = new Image()
|
||||||
|
img.crossOrigin = 'anonymous'
|
||||||
|
img.src = url
|
||||||
|
img.onload = () =>
|
||||||
|
imageCache[url] = img
|
||||||
|
action(img)
|
||||||
|
|
||||||
|
@setFaviconForDoc = (doc) ->
|
||||||
|
return if currentSlug == doc.slug
|
||||||
|
|
||||||
|
favicon = $('link[rel="icon"]')
|
||||||
|
|
||||||
|
if defaultUrl == null
|
||||||
|
defaultUrl = favicon.href
|
||||||
|
|
||||||
|
if urlCache[doc.slug]
|
||||||
|
favicon.href = urlCache[doc.slug]
|
||||||
|
currentSlug = doc.slug
|
||||||
|
return
|
||||||
|
|
||||||
|
styles = window.getComputedStyle($("._icon-#{doc.slug.split('~')[0]}"), ':before')
|
||||||
|
|
||||||
|
bgUrl = app.config.favicon_spritesheet
|
||||||
|
sourceSize = 16
|
||||||
|
sourceX = Math.abs(parseInt(styles['background-position-x'].slice(0, -2)))
|
||||||
|
sourceY = Math.abs(parseInt(styles['background-position-y'].slice(0, -2)))
|
||||||
|
|
||||||
|
withImage(bgUrl, (docImg) ->
|
||||||
|
withImage(defaultUrl, (defaultImg) ->
|
||||||
|
size = defaultImg.width
|
||||||
|
|
||||||
|
canvas = document.createElement('canvas')
|
||||||
|
ctx = canvas.getContext('2d')
|
||||||
|
|
||||||
|
canvas.width = size
|
||||||
|
canvas.height = size
|
||||||
|
ctx.drawImage(defaultImg, 0, 0)
|
||||||
|
|
||||||
|
docIconPercentage = 65
|
||||||
|
destinationCoords = size / 100 * (100 - docIconPercentage)
|
||||||
|
destinationSize = size / 100 * docIconPercentage
|
||||||
|
ctx.drawImage(docImg, sourceX, sourceY, sourceSize, sourceSize, destinationCoords, destinationCoords, destinationSize, destinationSize)
|
||||||
|
|
||||||
|
urlCache[doc.slug] = canvas.toDataURL()
|
||||||
|
favicon.href = urlCache[doc.slug]
|
||||||
|
|
||||||
|
currentSlug = doc.slug
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
@resetFavicon = () ->
|
||||||
|
if defaultUrl != null and currentSlug != null
|
||||||
|
$('link[rel="icon"]').href = defaultUrl
|
||||||
|
currentSlug = null
|
@ -1,182 +0,0 @@
|
|||||||
%svg-icon {
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: top;
|
|
||||||
width: 1rem;
|
|
||||||
height: 1rem;
|
|
||||||
pointer-events: none;
|
|
||||||
fill: currentColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
%doc-icon {
|
|
||||||
content: '';
|
|
||||||
display: block;
|
|
||||||
width: 1rem;
|
|
||||||
height: 1rem;
|
|
||||||
background-image: image-url('docs-1.png');
|
|
||||||
background-size: 10rem 10rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
%doc-icon-2 { background-image: image-url('docs-2.png') !important; }
|
|
||||||
|
|
||||||
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) {
|
|
||||||
%doc-icon { background-image: image-url('docs-1@2x.png'); }
|
|
||||||
%doc-icon-2 { background-image: image-url('docs-2@2x.png') !important; }
|
|
||||||
}
|
|
||||||
|
|
||||||
html._theme-dark {
|
|
||||||
%darkIconFix {
|
|
||||||
filter: invert(100%) grayscale(100%);
|
|
||||||
-webkit-filter: invert(100%) grayscale(100%);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
._icon-jest:before { background-position: 0 0; }
|
|
||||||
._icon-liquid:before { background-position: -1rem 0; }
|
|
||||||
._icon-openjdk:before { background-position: -2rem 0; }
|
|
||||||
._icon-codeceptjs:before { background-position: -3rem 0; }
|
|
||||||
._icon-codeception:before { background-position: -4rem 0; }
|
|
||||||
._icon-sqlite:before { background-position: -5rem 0; @extend %darkIconFix !optional; }
|
|
||||||
._icon-async:before { background-position: -6rem 0; @extend %darkIconFix !optional; }
|
|
||||||
._icon-http:before { background-position: -7rem 0; @extend %darkIconFix !optional; }
|
|
||||||
._icon-jquery:before { background-position: -8rem 0; @extend %darkIconFix !optional; }
|
|
||||||
._icon-underscore:before { background-position: -9rem 0; @extend %darkIconFix !optional; }
|
|
||||||
._icon-html:before { background-position: 0 -1rem; }
|
|
||||||
._icon-css:before { background-position: -1rem -1rem; }
|
|
||||||
._icon-dom:before { background-position: -2rem -1rem; }
|
|
||||||
._icon-dom_events:before { background-position: -3rem -1rem; }
|
|
||||||
._icon-javascript:before { background-position: -4rem -1rem; }
|
|
||||||
._icon-backbone:before { background-position: -5rem -1rem; @extend %darkIconFix !optional; }
|
|
||||||
._icon-node:before,
|
|
||||||
._icon-node_lts:before { background-position: -6rem -1rem; }
|
|
||||||
._icon-sass:before { background-position: -7rem -1rem; }
|
|
||||||
._icon-less:before { background-position: -8rem -1rem; }
|
|
||||||
._icon-angularjs:before { background-position: -9rem -1rem; }
|
|
||||||
._icon-coffeescript:before { background-position: 0 -2rem; @extend %darkIconFix !optional; }
|
|
||||||
._icon-ember:before { background-position: -1rem -2rem; }
|
|
||||||
._icon-yarn:before { background-position: -2rem -2rem; }
|
|
||||||
._icon-immutable:before { background-position: -3rem -2rem; @extend %darkIconFix !optional; }
|
|
||||||
._icon-jqueryui:before { background-position: -4rem -2rem; }
|
|
||||||
._icon-jquerymobile:before { background-position: -5rem -2rem; }
|
|
||||||
._icon-lodash:before { background-position: -6rem -2rem; }
|
|
||||||
._icon-php:before { background-position: -7rem -2rem; }
|
|
||||||
._icon-ruby:before,
|
|
||||||
._icon-minitest:before { background-position: -8rem -2rem; }
|
|
||||||
._icon-rails:before { background-position: -9rem -2rem; }
|
|
||||||
._icon-python:before,
|
|
||||||
._icon-python2:before { background-position: 0 -3rem; }
|
|
||||||
._icon-git:before { background-position: -1rem -3rem; }
|
|
||||||
._icon-redis:before { background-position: -2rem -3rem; }
|
|
||||||
._icon-postgresql:before { background-position: -3rem -3rem; }
|
|
||||||
._icon-d3:before { background-position: -4rem -3rem; }
|
|
||||||
._icon-knockout:before { background-position: -5rem -3rem; }
|
|
||||||
._icon-moment:before { background-position: -6rem -3rem; @extend %darkIconFix !optional; }
|
|
||||||
._icon-c:before { background-position: -7rem -3rem; }
|
|
||||||
._icon-statsmodels:before { background-position: -8rem -3rem; }
|
|
||||||
._icon-yii:before,
|
|
||||||
._icon-yii1:before { background-position: -9rem -3rem; }
|
|
||||||
._icon-cpp:before { background-position: 0 -4rem; }
|
|
||||||
._icon-go:before { background-position: -1rem -4rem; }
|
|
||||||
._icon-express:before { background-position: -2rem -4rem; }
|
|
||||||
._icon-grunt:before { background-position: -3rem -4rem; }
|
|
||||||
._icon-rust:before { background-position: -4rem -4rem; @extend %darkIconFix !optional; }
|
|
||||||
._icon-laravel:before { background-position: -5rem -4rem; }
|
|
||||||
._icon-haskell:before { background-position: -6rem -4rem; }
|
|
||||||
._icon-requirejs:before { background-position: -7rem -4rem; }
|
|
||||||
._icon-chai:before { background-position: -8rem -4rem; }
|
|
||||||
._icon-sinon:before { background-position: -9rem -4rem; }
|
|
||||||
._icon-cordova:before { background-position: 0 -5rem; }
|
|
||||||
._icon-markdown:before { background-position: -1rem -5rem; @extend %darkIconFix !optional; }
|
|
||||||
._icon-django:before { background-position: -2rem -5rem; }
|
|
||||||
._icon-xslt_xpath:before { background-position: -3rem -5rem; }
|
|
||||||
._icon-nginx:before,
|
|
||||||
._icon-nginx_lua_module:before { background-position: -4rem -5rem; }
|
|
||||||
._icon-svg:before { background-position: -5rem -5rem; }
|
|
||||||
._icon-marionette:before { background-position: -6rem -5rem; }
|
|
||||||
._icon-jsdoc:before,
|
|
||||||
._icon-koa:before,
|
|
||||||
._icon-graphite:before,
|
|
||||||
._icon-mongoose:before { background-position: -7rem -5rem; }
|
|
||||||
._icon-phpunit:before { background-position: -8rem -5rem; }
|
|
||||||
._icon-nokogiri:before { background-position: -9rem -5rem; @extend %darkIconFix !optional; }
|
|
||||||
._icon-rethinkdb:before { background-position: 0 -6rem; }
|
|
||||||
._icon-react:before { background-position: -1rem -6rem; }
|
|
||||||
._icon-socketio:before { background-position: -2rem -6rem; }
|
|
||||||
._icon-modernizr:before { background-position: -3rem -6rem; }
|
|
||||||
._icon-bower:before { background-position: -4rem -6rem; }
|
|
||||||
._icon-fish:before { background-position: -5rem -6rem; @extend %darkIconFix !optional; }
|
|
||||||
._icon-scikit_image:before { background-position: -6rem -6rem; }
|
|
||||||
._icon-twig:before { background-position: -7rem -6rem; }
|
|
||||||
._icon-pandas:before { background-position: -8rem -6rem; }
|
|
||||||
._icon-scikit_learn:before { background-position: -9rem -6rem; }
|
|
||||||
._icon-bottle:before { background-position: 0 -7rem; }
|
|
||||||
._icon-docker:before { background-position: -1rem -7rem; }
|
|
||||||
._icon-cakephp:before { background-position: -2rem -7rem; }
|
|
||||||
._icon-lua:before { background-position: -3rem -7rem; @extend %darkIconFix !optional; }
|
|
||||||
._icon-clojure:before { background-position: -4rem -7rem; }
|
|
||||||
._icon-symfony:before { background-position: -5rem -7rem; }
|
|
||||||
._icon-mocha:before { background-position: -6rem -7rem; }
|
|
||||||
._icon-meteor:before { background-position: -7rem -7rem; @extend %darkIconFix !optional; }
|
|
||||||
._icon-npm:before { background-position: -8rem -7rem; }
|
|
||||||
._icon-apache_http_server:before { background-position: -9rem -7rem; }
|
|
||||||
._icon-drupal:before { background-position: 0 -8rem; }
|
|
||||||
._icon-webpack:before { background-position: -1rem -8rem; }
|
|
||||||
._icon-phaser:before { background-position: -2rem -8rem; }
|
|
||||||
._icon-vue:before { background-position: -3rem -8rem; }
|
|
||||||
._icon-opentsdb:before { background-position: -4rem -8rem; }
|
|
||||||
._icon-q:before { background-position: -5rem -8rem; }
|
|
||||||
._icon-crystal:before { background-position: -6rem -8rem; @extend %darkIconFix !optional; }
|
|
||||||
._icon-julia:before { background-position: -7rem -8rem; @extend %darkIconFix !optional; }
|
|
||||||
._icon-redux:before { background-position: -8rem -8rem; @extend %darkIconFix !optional; }
|
|
||||||
._icon-bootstrap:before { background-position: -9rem -8rem; }
|
|
||||||
._icon-react_native:before { background-position: 0 -9rem; }
|
|
||||||
._icon-phalcon:before { background-position: -1rem -9rem; }
|
|
||||||
._icon-matplotlib:before { background-position: -2rem -9rem; }
|
|
||||||
._icon-cmake:before { background-position: -3rem -9rem; }
|
|
||||||
._icon-elixir:before { background-position: -4rem -9rem; @extend %darkIconFix !optional; }
|
|
||||||
._icon-vagrant:before { background-position: -5rem -9rem; }
|
|
||||||
._icon-dojo:before { background-position: -6rem -9rem; }
|
|
||||||
._icon-flow:before { background-position: -7rem -9rem; }
|
|
||||||
._icon-relay:before { background-position: -8rem -9rem; }
|
|
||||||
._icon-phoenix:before { background-position: -9rem -9rem; }
|
|
||||||
|
|
||||||
._icon-tcl_tk:before { background-position: 0 0; @extend %doc-icon-2; }
|
|
||||||
._icon-erlang:before { background-position: -1rem 0; @extend %doc-icon-2; }
|
|
||||||
._icon-chef:before { background-position: -2rem 0; @extend %doc-icon-2; }
|
|
||||||
._icon-ramda:before { background-position: -3rem 0; @extend %doc-icon-2; @extend %darkIconFix !optional; }
|
|
||||||
._icon-codeigniter:before { background-position: -4rem 0; @extend %doc-icon-2; @extend %darkIconFix !optional; }
|
|
||||||
._icon-influxdata:before { background-position: -5rem 0; @extend %doc-icon-2; @extend %darkIconFix !optional; }
|
|
||||||
._icon-tensorflow:before { background-position: -6rem 0; @extend %doc-icon-2; }
|
|
||||||
._icon-haxe:before { background-position: -7rem 0; @extend %doc-icon-2; }
|
|
||||||
._icon-ansible:before { background-position: -8rem 0; @extend %doc-icon-2; @extend %darkIconFix !optional; }
|
|
||||||
._icon-typescript:before { background-position: -9rem 0; @extend %doc-icon-2; }
|
|
||||||
._icon-browser_support_tables:before { background-position: 0rem -1rem; @extend %doc-icon-2; }
|
|
||||||
._icon-gnu_fortran:before { background-position: -1rem -1rem; @extend %doc-icon-2; }
|
|
||||||
._icon-gcc:before { background-position: -2rem -1rem; @extend %doc-icon-2; }
|
|
||||||
._icon-perl:before { background-position: -3rem -1rem; @extend %doc-icon-2; }
|
|
||||||
._icon-apache_pig:before { background-position: -4rem -1rem; @extend %doc-icon-2; }
|
|
||||||
._icon-numpy:before { background-position: -5rem -1rem; @extend %doc-icon-2; }
|
|
||||||
._icon-kotlin:before { background-position: -6rem -1rem; @extend %doc-icon-2; }
|
|
||||||
._icon-padrino:before { background-position: -7rem -1rem; @extend %doc-icon-2; }
|
|
||||||
._icon-angular:before { background-position: -8rem -1rem; @extend %doc-icon-2; }
|
|
||||||
._icon-love:before { background-position: -9rem -1rem; @extend %doc-icon-2; }
|
|
||||||
._icon-jasmine:before { background-position: 0 -2rem; @extend %doc-icon-2; }
|
|
||||||
._icon-pug:before { background-position: -1rem -2rem; @extend %doc-icon-2; }
|
|
||||||
._icon-electron:before { background-position: -2rem -2rem; @extend %doc-icon-2; }
|
|
||||||
._icon-falcon:before { background-position: -3rem -2rem; @extend %doc-icon-2; }
|
|
||||||
._icon-godot:before { background-position: -4rem -2rem; @extend %doc-icon-2; }
|
|
||||||
._icon-nim:before { background-position: -5rem -2rem; @extend %doc-icon-2; @extend %darkIconFix !optional; }
|
|
||||||
._icon-vulkan:before { background-position: -6rem -2rem; @extend %doc-icon-2; @extend %darkIconFix !optional; }
|
|
||||||
._icon-d:before { background-position: -7rem -2rem; @extend %doc-icon-2; }
|
|
||||||
._icon-bluebird:before { background-position: -8rem -2rem; @extend %doc-icon-2; }
|
|
||||||
._icon-eslint:before { background-position: -9rem -2rem; @extend %doc-icon-2; }
|
|
||||||
._icon-homebrew:before { background-position: 0 -3rem; @extend %doc-icon-2; }
|
|
||||||
._icon-jekyll:before { background-position: -1rem -3rem; @extend %doc-icon-2; }
|
|
||||||
._icon-babel:before { background-position: -2rem -3rem; @extend %doc-icon-2; }
|
|
||||||
._icon-leaflet:before { background-position: -3rem -3rem; @extend %doc-icon-2; }
|
|
||||||
._icon-terraform:before { background-position: -4rem -3rem; @extend %doc-icon-2; }
|
|
||||||
._icon-pygame:before { background-position: -5rem -3rem; @extend %doc-icon-2; }
|
|
||||||
._icon-bash:before { background-position: -6rem -3rem; @extend %doc-icon-2; }
|
|
||||||
._icon-dart:before { background-position: -7rem -3rem; @extend %doc-icon-2; }
|
|
||||||
._icon-qt:before { background-position: -8rem -3rem; @extend %doc-icon-2; }
|
|
||||||
._icon-puppeteer:before { background-position: -9rem -3rem; @extend %doc-icon-2; }
|
|
||||||
._icon-handlebars:before { background-position: 0 -4rem; @extend %doc-icon-2; @extend %darkIconFix !optional; }
|
|
@ -0,0 +1,43 @@
|
|||||||
|
<% manifest = JSON.parse(File.read('assets/images/sprites/docs.json')) %>
|
||||||
|
|
||||||
|
%svg-icon {
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: top;
|
||||||
|
width: 1rem;
|
||||||
|
height: 1rem;
|
||||||
|
pointer-events: none;
|
||||||
|
fill: currentColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
%doc-icon {
|
||||||
|
content: '';
|
||||||
|
display: block;
|
||||||
|
width: 1rem;
|
||||||
|
height: 1rem;
|
||||||
|
background-image: image-url('sprites/docs.png');
|
||||||
|
background-size: <%= manifest['icons_per_row'] %>rem <%= manifest['icons_per_row'] %>rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) {
|
||||||
|
%doc-icon { background-image: image-url('sprites/docs@2x.png'); }
|
||||||
|
}
|
||||||
|
|
||||||
|
html._theme-dark {
|
||||||
|
%darkIconFix {
|
||||||
|
filter: invert(100%) grayscale(100%);
|
||||||
|
-webkit-filter: invert(100%) grayscale(100%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<%=
|
||||||
|
items = []
|
||||||
|
|
||||||
|
manifest['items'].each do |item|
|
||||||
|
rules = []
|
||||||
|
rules << "background-position: -#{item['col']}rem -#{item['row']}rem;"
|
||||||
|
rules << "@extend %darkIconFix !optional;" if item['dark_icon_fix']
|
||||||
|
items << "._icon-#{item['type']}:before { #{rules.join(' ')} }"
|
||||||
|
end
|
||||||
|
|
||||||
|
items.join('')
|
||||||
|
%>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue