Polymer provides you with all the necessary tools to add Material design elements to your web applications; in addition, it is also a very good development framework. As smartphones, large phones, and tablets approach the power of PCs, the user experience on mobile and desktop is becoming more and more consistent. One of the core concepts of this consistency is to use a universal design language for both mobile and web applications. With this in mind, Microsoft developed a modern design language to build the foundation of the WinJS library, and BlackBerry also used its own Cascade to build features in bbUI.js. Last year, Google launched its Material Design language and its Plymer framework. As a basic mechanism, Material Design can help developers design products that match Google's appearance and user experience in the latest Android system. It also provides our code with native UI components and a complete set of web components for matching effects. Based on the latest Web technologies, Polymer is a framework for building reusable UI components for applications. Much like React, it can extract page elements in its own way and use them as the basis for design. The existence of the element catalog simplifies the use process, helping users to more easily view and select the elements they need, and apply them to the page as standard HTML elements. Need to add a map? All you need to do is find the right Polymer map element, import it, and then call it as a tag. Although Polymer mainly uses modern web standards, especially web components, it can also run smoothly on relatively old browsers. You can use the polyfill middleware to load the necessary libraries on old browsers with a JavaScript code to give them support for a specific subset of web components. Initially, we need to use tools like Bower to ensure that when we install a component, we also install all its dependencies. This means setting up a suitable configuration file for our application, but once Polymer is installed via the Bower command line, it will always be kept up to date. You can also choose to download a Zip file for the entire Polymer version, but this will not allow for automatic updates (and if you use GitHub, you will need to manage dependencies yourself). Once installed, all you have to do is import your pages to make sure you add the core Polymer functionality before defining elements. You can create new elements from scratch, build a template, and add content. Once you have an element created, you can start combining it with other elements, taking advantage of Polymer's AJAX support to add data binding and external API connections via JSON. Polymer also lets you hook up your own elements to a public API so they can react to certain events and process data. The capabilities you can get from this are endless, and it's at the heart of how Polymer enables dynamic content delivery. You can introduce events into every aspect of an element's lifecycle, from the moment it's created, all the way to the element. This lets you give elements new features, like signaling when they're ready to be called upon. You can also add declarative data bindings to elements, making it easier to populate them with content from external data sources. Once we have an API for an element, we can publish its properties so that they work similarly to HTML attributes. It is then a simple matter to link an element's data binding to a property, allowing designers to quickly set the property - just like they would for any traditional HTML element. The core advantage of using Polymer is to build design elements for specific applications: once built, they are essentially equivalent to HTML tags. Developers can build and record an element, and designers can use it in page layout. In this way, we do not need to learn new development mechanisms, but can ensure that developers and designers take full advantage of the flexibility of Polymer to build easy-to-understand web applications. Google's Polymer component library provides you with a variety of tool options for adding Material Design elements to your web applications, but it also serves as a development framework to help you build your own components or customize existing elements as needed. You can also use Polymer templates with data binding to deliver dynamic content, that is, provide components with data to process. Once you build or import a Polymer element, it will work the same as any HTML element, which means you can quickly build more complex UI features using these basic elements. You can also use a set of themed elements (Google calls them "paper elements"), or use non-themed components that work with existing designs. A core feature of Material Design and Polymer is that it can significantly simplify page layouts using icons. In the process of building the familiar Android UI, Polymer uses a set of icon components to add SVG images to the page, and more than 150 icons directly provided in the library can be called by name and added to the application. Similarly, it also provides a large library of controls that allow us to use them directly in the page. In traditional UI frameworks and HTML, you may need to write a lot of code to achieve certain design goals, such as adding a progress bar to an application - but with Polymer, we can directly use it as a simple element that can be assigned a value, and then use it for other frameworks such as Angular. In this way, it becomes very easy to build dynamic elements in single-page web applications. While Polymer is an interesting and very flexible UI framework, its real value lies in proving that web components can indeed be used in our applications. With full support for Chrome, Opera, Firefox, Safari, and recently Microsoft Edge, these components are likely to quickly become the core of UI element delivery, especially considering the significant appeal of small and fast web applications that they promise. Replacing the original bulky JavaScript UI with these elements that are only loaded when needed is obviously very practical, and small pages will make the mobile web more friendly while greatly reducing the cost of coding for developers. |
<<: Start with these four aspects to become a great CTO
This article aims to analyze the current status o...
This task is usually led by the product director ...
The main factors affecting the price of mini prog...
As a highly cost-effective promotion channel, min...
Report! Tencent is here again, bringing the lates...
Wil Shipley is a senior developer who worked at N...
The main purpose of writing this article is to su...
How to apply for a 400 service phone number? How ...
Yesterday morning, Apple finally released the iOS...
More and more smartphones are beginning to cancel...
Marketing and promotion are always the pain point...
The Chengdu Auto Show is underway, and compared w...
This time I want to talk to you about product ope...
In the past two years, we have seen H5s produced ...
Online promotion in the education industry has al...