Git Product home page Git Product logo

atom-polymersnippets's Introduction

Polymer Snippets for Atom

banner

Demo

Install

Go to atom > Preferences... then search for Polymer Snippets in Packages tab.

Polymer

[pe] polymer element

${1:<link rel="import" href="../polymer/polymer.html">}
<polymer-element name="${2}" attributes="${3}">
  <template>
    <style>
      :host {
        display: block;
      }
    </style>$4
  </template>
  <script>
    Polymer('$2', {

    });
  </script>
</polymer-element>

[pen] polymer element noscript

${1:<link rel="import" href="../polymer/polymer.html">}
<polymer-element name="${2}" noscript>
  <template>
    <style>
      :host {
        display: block;
      }
    </style>$4
  </template>
</polymer-element>

[hic] html import core-element

<link rel="import" href="${1:bower_components}/core-${2}/core-${2}.html">

[hip] html import polymer-ui-element

<link rel="import" href="${1:bower_components}/polymer-ui-${2}/polymer-ui-${2}.html">

Web Components

[tm] template

<template$1>$0</template>

[hi] html import

<link rel="import" href="${0}">

[ce] custom element

var ${4:tmpl} = document.querySelector('${5:template}');

var ${1:WidgetProto} = Object.create(HTMLElement.prototype);

${1:WidgetProto}.createdCallback = function() {
  var root = this.createShadowRoot();
  root.appendChild(document.importNode(${4:tmpl}.content, true));
};

var ${2:Widget} = document.registerElement('${3:my-widget}', {
  prototype: ${1:WidgetProto}
});

[sh] /shadow/

/shadow/ ${2:target} {
  $0
}

[sd] /shadow-deep/

/shadow-deep/ ${2:target} {
  $0
}

[cn] content /content/

${1:content} /content/ ${2:target} {
  $0
}

[ho] :host

:host$0

[an] :ancestor()

:ancestor($0)

[pf] polyfill-next-selector

polyfill-next-selector { content: '${1::host > .foo}'; }$0

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -m 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

MIT License © Rob Dodson

atom-polymersnippets's People

Contributors

robdodson avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.