~repos /atoms-element

#js

git clone https://pyrossh.dev/repos/atoms-element.git

A simple web component library for defining your custom elements. It works on both client and server.


c8822d75 Peter John

4 years ago
fix css indent
Files changed (3) hide show
  1. __snapshots__/index.test.js.snap +6 -6
  2. index.js +1 -1
  3. index.test.js +0 -1
__snapshots__/index.test.js.snap CHANGED
@@ -81,20 +81,20 @@ exports[`createElement 1`] = `
81
81
  exports[`css 1`] = `
82
82
  "button {
83
83
 
84
- color: magenta;
84
+ color: magenta;
85
85
  font-size: 10px;
86
86
 
87
- font-size: 64px;
87
+ font-size: 64px;
88
88
 
89
- color: black;
89
+ color: black;
90
90
 
91
-
91
+
92
- color: navy;
92
+ color: navy;
93
93
 
94
94
  }
95
95
  container {
96
96
 
97
- flex: 1;
97
+ flex: 1;
98
98
  align-items: center;
99
99
  justify-content: center;
100
100
 
index.js CHANGED
@@ -10,7 +10,7 @@ export const css = (obj, isChild = false, indent = '') => {
10
10
  const value = obj[key];
11
11
  acc += !isChild ? `${key} {\n` : '';
12
12
  if (typeof value === 'object') {
13
- acc += '\n ' + indent + css(value, true, indent + ' ');
13
+ acc += '\n' + css(value, true, indent + ' ');
14
14
  } else {
15
15
  acc += ' ' + indent + hyphenate(key) + ': ' + value + ';\n';
16
16
  }
index.test.js CHANGED
@@ -278,7 +278,6 @@ test('AtomsElement', async () => {
278
278
  });
279
279
  instance.renderItem = () => html`<div><p>render item 1</p></div>`;
280
280
  expect(AppItem.observedAttributes).toEqual(['perpage', 'address']);
281
- console.log('instance', instance.attrs);
282
281
  const res = instance.renderTemplate();
283
282
  expect(res).toMatchSnapshot();
284
283
  });