Comments (4)
Just to confirm, I hacked on the flexboxgrid2 demo page and got the same result by essentially doing:
.col {
/* Need these two to override /
flex: 1 1 auto;
max-width: initial;
}
.col:not(:last-child) {
margin-right: 24px; / creates the gap between the cards */
}
So my thought is that we'd need to provide something like:
<FlexCol sm={12} lg={auto}>...</FlexCol>
and the cards would stack at extra small and small, but then use auto from large upward
UPDATE: After learning of the auto width section of the original upstream library (see next comment), I don't think above idea is as good as adding opt in gutters.
from agnosticui.
Looking some more at https://evgenyrodionov.github.io/flexboxgrid2/ I'm reminded that the library automatically gives you magic gutters (which I've removed). So, if you look at their auto section it has the gutters inside if you don't supply any sizing classes for the columns. It does this by using padding-left and padding-right on the columns, and then negate corresponding margins on the row:
So perhaps what I need to do is provide a gutters={16}
which can be used as an escape hatch to opt back in to gutters for use cases like cards. Then, divide by / 2 and do padding left 8px right 8px and margin left -8px right -8px as they do.
Another benefit of this would be the consumer doesn't have to add ugly override CSS like:
.col:not(:last-child) {
margin-right: 24px;
}
and the cards just have nice inner gutters as you'd expect.
Additionally, besides having the feature of "opt in" gutters, the consumer also gets to curate the exact size of gutters they prefer which is also a nice thing.
from agnosticui.
Making progress on this but after iterating I think I want to change the strategy…
Instead of
.gutter-8,
.gutter-16
and so on, I think we should do this via css custom properties:
--agnosticui-default-gutter-desktop: 0,
--agnosticui-default-gutter-tablet: 0,
--agnosticui-default-gutter-phone: 0
Essentially, by default, you haven't opted in for gutters so it simply adds these with zero values e.g. margin-left: 0
etc.
This allows consumers to override via top-level stylesheet, and thus "opt-in" by simply declaring:
--agnosticui-gutter-desktop: 24px,
--agnosticui-gutter-tablet: 16px,
--agnosticui-gutter-phone: 8px
/* or whatever makes sense to them */
from agnosticui.
CSS and Vue packages are refactored. Need to update svelte/react ones.
from agnosticui.
Related Issues (20)
- [Feature request] Dynamic table content - Svelte HOT 3
- Lots of warnings of unused CSS selector HOT 1
- agnostic-svelte pagination component reactivity HOT 1
- [Svelte] <Input> on:input event is not being propagated HOT 1
- [svelte-kit] Cannot Load ES module from agnostic-helpers HOT 7
- [react] Are there any plans to add "forwardRefs" to your Input element? HOT 2
- [astro] Cannot find module or its corresponding type declarations HOT 2
- [Svelte] Icon.svelte.d.ts exports wrong type HOT 1
- Menu with Links as MenuItems HOT 2
- [Feature Request] Ability to click on header cell to sort by that column in Table component
- Tooltip Docs HOT 3
- Angular Tooltips
- Dark mode table hover makes text hard to read
- Legacy React dependency HOT 1
- [Svelte] Disabled attribute not applied to textarea
- Agnostic UI for Vue not working with Histoire HOT 2
- Upgrade to Storybook 7
- Unable to get agnostic-vue working with default settings
- Vue.js v-model binding does not work with Select
- Breadcrumbs example and Vue.js code broken on doc site, CodeSandbox, and Stackblitz HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from agnosticui.