Comments (6)
What's an example of where you'd see yourself using a grid design token? I'm struggling to see how this fits in.
from community-group.
In order to create grid layouts. If you're asking about my personal usage, so I use for grid layouts and in media queries. But I also have a breakpoint
property here:
$grid-desktop-breakpoint: 1440px;
$grid-desktop-padding: 50px;
$grid-desktop-columns: 12;
$grid-tablet-breakpoint: 1024px;
$grid-tablet-padding: 40px;
$grid-tablet-columns: 12;
$grid-mobile-breakpoint: 620px;
$grid-mobile-padding: 20px;
$grid-mobile-columns: 6;
I also have an article about building CSS grid system https://dev.to/pavellaptev/simple-grid-system-with-subgrid-classes-2f44
from community-group.
Sorry, to rephrase, why would you do this with design tokens instead of just writing grid
properties in CSS? Everyone here knows what grid layouts are and why they're useful, but I want to hear more about why you would like to express them in design tokens. How would writing grid layouts in design token JSON help you improve consistency between platforms or get designs from design tools to code more efficiently or eliminate tedious repetition?
from community-group.
Yes, good question. I think in general, it should help to align all platforms that are using grid layouts. Personally, I just want to have a standard type for it, so tools like Style Dictionary, could be aware about this type and I don't need to write additional modifiers.
Right now, I just want to see reaction on the proposal. I think if people didn't ask it before, might be it's not needed right now. But it's good to have an issue for it.
from community-group.
Hi all 👋🏽 . I stumbled across this issue because I am researching how we can use design tokens to handle different grid layouts just based on design tokens/css variables. I work at a large publisher/media company with over 100 publications and we have 4 different "themes", and in some cases the grid column numbers could be different across themes, in one specific component. So the regular spacing system would not solve our needs. So different themes is a use case where grid-layout tokens would be very useful.
from community-group.
My initial thought when seeing new token type proposals is to ask: can this be solved with groups? eg, without using a new token type, you might have this:
{
"grid": {
"columns": {
"count": {
"$type": "number",
"$value": 12
},
"gap": {
"$type": "dimension",
"$value": "10px"
},
"width": {
"$type": "dimension",
"$value": "100px"
},
"margin": {
"$type": "dimension",
"$value": "20px"
}
}
}
}
I think this still captures the spirit of the design decision; you could even add more context in $description props. If there's value in having the translator "know" that these values should be used to calculate, say, css grid syntax, perhaps that's just a configuration of the translator rather than explicit in the token itself. Eg:
generateCssGridSyntax({
columnCount: tokens.grid.columns.count,
columnWidth: tokens.grid.columns.width
});
// outputs something like
// grid-template-columns: repeat(12, 100px);
from community-group.
Related Issues (20)
- Consider using type: "$alias" for explicity
- Define how far design tokens are expected to be interoperable. HOT 1
- Remove REM/EM from specification? HOT 25
- Error in Font Weight example in spec?
- Standardizing the Handoff - Conceptual HOT 10
- Extensible Types HOT 2
- Specification / recommendation for custom types HOT 4
- Token Operations
- The $ property name prefix should be unnecessary with a well-structured schema HOT 10
- [Discussion]: How to transform composite tokens HOT 5
- Transition token documentation issue HOT 1
- Suggestion: colorList type for DataViz HOT 6
- Most recent edition (07/2023) missing from main page on w3c community group HOT 1
- A comment about history of design tokens HOT 2
- Type: Text alignment HOT 11
- Custom Types / Interpritations HOT 1
- Is there a way to still include boolean and string type functionality? HOT 1
- Be explicit about whether or not empty groups are allowed HOT 5
- Alias $type inheritance? HOT 4
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 community-group.