Troubleshooting Polymer 1.6: Issue with Element Styling

I've been struggling for hours to style a Polymer element. Despite following various guides and tutorials, nothing seems to be working.

Here is the code snippet: http://codepen.io/nanobird_/pen/pEWWqW/

Below is my DOM module code:

<script src="https://cdnjs.cloudflare.com/ajax/libs/polymer/0.5.6/polymer.min.js"></script>

<dom-module id="kink">
    <template strip-whitespace>
        <style>
            :host {
                display: inline-flex;
                border: 1px solid black;

                z-index: 0;
                line-height: 1;

                height: 40px;
                width: 16em;
                margin: 2px 8px;
            }

            #kink-color {
                width: 4px;
                background-color: aquamarine;
            }

            #kink-text {
                background-color: green;
                margin-left: 4px;
                text-overflow: ellipsis;
            }
        </style>

        <div id="kink-color"></div>
        <div id="kink-text"><content></content></div>
    </template>



    <script>
        Polymer({
            is: 'kink',

            properties: {
                pref: String
            }
        });
    </script>
</dom-module>

<kink pref="yes">Kink</kink>

The desired custom element should resemble the div group right below it - a box with a color swatch on the left side.

I can't seem to figure out what I'm doing wrong here. Any help would be greatly appreciated!

Answer №1

element-name
When defining a custom element, it is important that the name contains a dash (-), such as my-element.

For more information, check out

The naming convention for custom elements mandates the inclusion of a dash (-).

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Why is it that the dimensions of the video player alter when I include a poster image?

After browsing numerous discussions on this topic, I have encountered an issue where adding a poster image to the video element causes the size of the video player to change. <video src="/video.mp4" poster="/image.jpeg" class="v ...

Styling animations in React with inline styles

Exploring the world of React inline animation styling, I set out to create a toggle button. The goal was simple: when the user presses the button for the first time, I wanted a pop-up animated card to slide from left to right. On the second press, the card ...

Enhanced Floating Elements with jQuery on WordPress

I've inserted this code into my website (excluding the sections for configuring comments and headers): http://jsfiddle.net/WzLG2/3/ Here is the JavaScript snippet: jQuery.noConflict(); jQuery(document).ready(function() { var top = jQuery('#smi&a ...

Can the appearance of the Chrome browser be altered to resemble a printed page?

Simply put, I'm tackling a massive project right now. While my print.css is functioning perfectly, the task of constantly previewing the print page has become incredibly frustrating. What's more, it's impossible to inspect the page effectiv ...

Is it possible to dynamically change the color of a box shadow using an event handler?

I'm currently in the process of developing an application that consists of six distinct topics organized within a flexbox structure, complete with a box-shadow effect. My objective is to dynamically alter the color of the box-shadow through an event ...

The styling in Laravel Bootstrap does not appear to be functioning properly when the "public" portion is removed from the URL. However, adding "Public" back into

Primary View file When the URL is made public Upon exclusion of "public" from the URL the Bootstrap file can be found in public under Bootstrap/css/bootstrap.css ...

Enhance your Joomla! template design by incorporating Bootstrap 4.3 elements and seamlessly blending custom styles with Bootstrap aesthetics

I'm working on incorporating a template I created using HTML and CSS into Joomla! 4. One specific component is this navbar: <nav class="navbar navbar-default navbar-expand-md navbar-light bg-light sticky-top"> <div class="container"> ...

"Trouble with Animations: Animate.css not functioning

I've been attempting to implement the animate.css plugin into my code, but for some reason, I just can't seem to get it working properly. Can anyone point out where I may have made a mistake? Here is the code I am using: <html> <head& ...

Create a row that has a centered heading and a button aligned to the right using Bootstrap 4

I'm currently working with Bootstrap 4 and React. I'm attempting to centralize a h4 heading while also aligning a couple of buttons to the right, all within the same row. The issue I'm facing is that the h4 heading is only centered within th ...

Having trouble compiling your Vue project and running into the "No mixed spaces and tabs" error?

Below are the details with an error: Error Details: Failed to compile. ./src/components/Header.vue Module Error (from ./node_modules/eslint-loader/index.js): H:\project\VueProjects\stock-trader\src\components\Header.vue 27: ...

How can I center an image in HTML while maintaining a slight margin at the bottom

I am facing a minor issue with the bottom margin of an image. I can't figure out why there is a small gap between the image and the menu below. Can someone provide an explanation? My goal is to have the menu align perfectly with the image, but for so ...

How can I display videos inline using php and html?

I'm having an issue with my HTML and PHP code. The videos are showing up in a vertical line, even though I used inline-block in the CSS code. Can someone please help me out? I'm new to this and struggling. HTML Code: <div class="wrap"> &l ...

Modifying the location of an element in an array with jQuery

Using jQuery and JavaScript var movableItems = new Array(); movableItems.push($('#cloud1')); movableItems.push($('#comment1')); if(leftPressed == true){ for(var i = 0; i < movableItems ...

CSS Adaptation of Hover Interaction

I'm currently developing a user interface using Shiny and I've been working on creating some visually appealing buttons. I've managed to customize the colors as desired, but now I'm facing an issue with getting the button to darken when ...

Advantages of incorporating CSS modules into React/Vue development

I am curious about the advantages of incorporating CSS Modules into projects with React/Vue. At my workplace, developers currently utilize the following approach during development: return ( <div className={styles.User}> <div classNam ...

Customizing the Color Scheme of Dropdown Buttons in Bootstrap 4

I'm attempting to customize the button colors, but so far I've only been able to change them when hovering. Below is my HTML and CSS where I define the color change on hover: .nav > li > a:focus, .nav > li > a:hover { backg ...

The class name feature on the Drawer component is malfunctioning

React and material-ui are my tools of choice, but I've hit a roadblock. I'm attempting to define some custom CSS behavior for the drawer component, using the className property as recommended. However, despite following the instructions, it' ...

Troubleshooting in Next.js 13: Issue with module not being found while trying to reference a package containing CSS

Currently working with Next.js version 13.4.2 and I have included an npm package that comes with CSS styles and fonts. The issue arises when trying to utilize one of the CSS files within my application. In the layout.tsx file, I imported the CSS file as fo ...

Splitting columns evenly in a table with a width of 100%

Welcome to my first query on this platform. Despite my efforts to search for a solution, I couldn't find an explanation as to why my code isn't functioning correctly in Internet Explorer (10+). I have created three divs displayed as cells, each ...

Container will keep items from spreading out

Experiencing an issue with the card layout in my weather dashboard app. The cards within a container are not spreading out evenly to match the 100% width of the header. I want the container with the 5 cards to be the same width as the header and wrap prope ...