Skip to content

Commit

Permalink
Adds input addon items to CSS and Vue packages.
Browse files Browse the repository at this point in the history
  • Loading branch information
roblevintennis committed Oct 11, 2020
1 parent c5889b0 commit f5b908d
Show file tree
Hide file tree
Showing 12 changed files with 240 additions and 134 deletions.
1 change: 1 addition & 0 deletions agnosticui-css/demo-globals.css
Expand Up @@ -14,6 +14,7 @@
@import "headernav.css";
@import "headernavitem.css";
@import "input.css";
@import "inputaddonitem.css";
@import "progress.css";

body {
Expand Down
10 changes: 8 additions & 2 deletions agnosticui-css/index.html
Expand Up @@ -27,14 +27,20 @@ <h1>Please open each individual component's page</h1>
<a href="/button.html">Button</a>
</li>
<li>
<a href="/progress.html">Progress</a>
<a href="/card.html">Card</a></p>
</li>
<li>
<a href="/card.html">Card</a></p>
<a href="/flexboxgrid.html">Flexbox Grid</a>
</li>
<li>
<a href="/header.html">Header</a></p>
</li>
<li>
<a href="/input.html">Input</a>
</li>
<li>
<a href="/progress.html">Progress</a>
</li>
</ul>
</body>

Expand Down
36 changes: 9 additions & 27 deletions agnosticui-css/input.css
Expand Up @@ -267,40 +267,22 @@ borders that visually conflict. */
cursor: not-allowed;
}


/*
* Input addons e.g. icons inside the input
*/
.input-has-left-addon,
.input-has-right-addon,
.input-addon-container {
/* Maybe I should have defined another css prop for addon adjustments but trying
to avoid any extra variable explosion there--will need to keep an eye on this */
--addon-padding: calc(var(--agnosticui-input-side-padding) * 1.5);
}
/**
* Input "has addon"
*/

.input-addon-container {
display: flex;
position: relative;
width: 100%;
}
.input-addon-container .input {
flex: 1;
}

.input-addon-container .input-addon-right,
.input-addon-container .input-addon-left {
position: absolute;
top: 50%;
transform: translateY(-50%);
}

.input-addon-container .input-addon-left {
left: var(--addon-padding);
}

.input-addon-container .input-addon-right {
right: var(--addon-padding);
.input-has-left-addon,
.input-has-right-addon {
/* Maybe I should have defined another css prop for addon adjustments but trying
to avoid any extra variable explosion there--will need to keep an eye on this */
--addon-padding: calc(var(--agnosticui-input-side-padding) * 1.5);
flex: 1;
}

.input-has-left-addon {
Expand Down
20 changes: 20 additions & 0 deletions agnosticui-css/inputaddonitem.css
@@ -0,0 +1,20 @@
/*
* Input addons e.g. icons inside the input
*/
.input-addon-right,
.input-addon-left {
/* Maybe I should have defined another css prop for addon adjustments but trying
to avoid any extra variable explosion there--will need to keep an eye on this */
--addon-padding: calc(var(--agnosticui-input-side-padding) * 1.5);
position: absolute;
top: 50%;
transform: translateY(-50%);
}

.input-addon-left {
left: var(--addon-padding);
}

.input-addon-right {
right: var(--addon-padding);
}
2 changes: 1 addition & 1 deletion agnosticui-react/src/css/common.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion agnosticui-svelte/src/css/common.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions agnosticui-vue/copystyles.js
Expand Up @@ -82,3 +82,8 @@ css = fs.readFileSync('../agnosticui-css/input.css', 'utf8');
const inputVue = fs.readFileSync('./src/stories/Input.vue', 'utf8');
const inputSynchronized = inputVue.replace(styleRegex, `<style module>\n${css}\n</style>`);
fs.writeFileSync('./src/stories/Input.vue', inputSynchronized, 'utf8');

css = fs.readFileSync('../agnosticui-css/inputaddonitem.css', 'utf8');
const inputAddonItemVue = fs.readFileSync('./src/stories/InputAddonItem.vue', 'utf8');
const inputAddonItemSynchronized = inputAddonItemVue.replace(styleRegex, `<style module>\n${css}\n</style>`);
fs.writeFileSync('./src/stories/InputAddonItem.vue', inputAddonItemSynchronized, 'utf8');
2 changes: 1 addition & 1 deletion agnosticui-vue/src/css/common.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f5b908d

Please sign in to comment.