Skip to content

Commit 72565d0

Browse files
authored
Merge pull request #578 from dxc-technology/component-card
Component card documentation update
2 parents f7c5b83 + d25da90 commit 72565d0

File tree

6 files changed

+54
-46
lines changed

6 files changed

+54
-46
lines changed
1.95 MB
Binary file not shown.

guidelines/components/card/README.md

Lines changed: 54 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,34 @@ A card can be defined as a unit, so it has all the information within it, making
55

66
The structure of the card can be seen as blocks, each block is optional to be displayed but the overall element should make a cohesive design, even if it includes text, images or other elements.
77

8-
## Appearance
8+
## Usage
99

10-
Even a card is defined as a unit by itself, it is common to represent cards in a set, with a grid structure in which each card has different information but from the same field.
10+
* Organize the card collection so thery are easy to use, take a layout that presents the information in a clear way and apply the same styles for every card
11+
* If a collection want be create, won't use different card styles, use the same to keep consistency
1112

12-
### Modes
1313

14-
The card component doesn't have modes, instead the component has many ways of configuration with images, custom containers and background colors to adapt it to the needs of the UI.
14+
## States
1515

16-
![Card modes](images/card_modes.png)
16+
Component states: **Enabled**, **hover** and **focus**.
1717

18-
### States
18+
![Card component states](images/card_states.png)
1919

20-
The only state that is controlled in the card component is the hover. As it is needed visual feedback to give the user a notion of which card is involve in the action, the rest of the states are directly dependent on the components defined inside of the card.
20+
_Card component states_
2121

22-
![Card states](images/card_states.png)
22+
## Anatomy
23+
24+
![Card anatomy](images/card_anatomy.png)
25+
26+
1. Card image
27+
2. Custom content
28+
3. Container
2329

2430

2531
## Design Specifications
2632

33+
![Card design specifications](images/card_specs.png)
34+
35+
_Card design specifications_
2736
### Color
2837

2938
| Component token | Element | Core token | Value |
@@ -32,6 +41,40 @@ The only state that is controlled in the card component is the hover. As it is n
3241

3342
* The `background-color` token belongs to the box component, changes made on that component will affect the card element.
3443

44+
### Border
45+
46+
| Property | Element | Core token | Value |
47+
| :----------------------- | :--------------- | :------------------------- | :--------------- |
48+
| `border-width` | Container | `border-width-0` | 0 |
49+
| `border-style` | Container | `border-style-none` | none |
50+
| `border-radius` | Container | `border-radius-medium` | 0.25rem / 4px |
51+
52+
53+
### Spacing
54+
55+
| Property | Element | Core token | Value |
56+
| :----------------------- | :----------------------- | :------------------------- | :--------------- |
57+
| `margin-top` | Custom content- subtitle | `spacing-02` | 0.25rem / 4px |
58+
| `margin-bottom` | Custom content- title | `spacing-05` | 1rem / 16px |
59+
| `padding-left` | Custom content | `spacing-06` | 1.5rem / 24px |
60+
| `padding-top` | Custom content | `spacing-06` | 1.5rem / 24px |
61+
| `padding-bottom` | Custom content | `spacing-06` | 1.5rem / 24px |
62+
| `padding-right` | Container | `spacing-06` | 1.5rem / 24px |
63+
64+
65+
### Size
66+
67+
| Component token | Element | Core token | Value |
68+
| :------------------------------------------ | :--------------------------- | :--------------------- | :------ |
69+
| `height` | Container height | - | 220px |
70+
| `width` | Container width | - | 400px |
71+
72+
73+
| Property | Element | Value |
74+
| :------------------------------------------ | :--------------------------- | :------ |
75+
| `max-width` | Image | 140px |
76+
77+
3578
### Margin
3679

3780
Margin properties can be applied independently to `top`, `right`, `bottom` and `left` sides of the card container.
@@ -63,49 +106,14 @@ padding | value
63106
```xxlarge``` | 100px
64107

65108

66-
### Border
67-
68-
| Property | Element | Core token | Value |
69-
| :----------------------- | :--------------- | :------------------------- | :--------------- |
70-
| `border-width` | Container | `border-width-0` | 0 |
71-
| `border-style` | Container | `border-style-none` | none |
72-
| `border-radius` | Container | `border-radius-medium` | 0.25rem / 4px |
73-
74-
75-
### Size
76-
77-
| Component token | Element | Core token | Value |
78-
| :------------------------------------------ | :--------------------------- | :--------------------- | :------ |
79-
| `height` | Container height | - | 220px |
80-
| `width` | Container width | - | 400px |
81-
82-
83-
| Property | Element | Value |
84-
| :------------------------------------------ | :--------------------------- | :------ |
85-
| `max-width` | Image | 140px |
86-
87109

88110

89111

90-
### Spacing
91-
92-
| Property | Value |
93-
| ---------------------------- | ------- |
94-
| Space title-subtitle | `4px` |
95-
| Space main info to paragraph | `20px` |
96-
| Space actions to photo | `20px` |
97-
98-
![Card specifications](images/card_specs.png)
99-
100-
### User Interface Design Considerations
101-
102-
- Organize the card collection so thery are easy to use, take a layout that presents the information in a clear way and apply the same styles for every card
103-
- If a collection want be create, won't use different card styles, use the same to keep consistency
104-
105112
## Links and references
106113

107-
- https://xd.adobe.com/view/23e2cca4-5021-490a-a548-e99a9b4a2006-76b1/screen/cca4ba93-1008-40ce-a7a5-89fbc21f665f/variables/
108-
114+
* [React component](https://developer.dxc.com/tools/react/next/#/components/card)
115+
* [Angular component](https://developer.dxc.com/tools/angular/next/#/components/card)
116+
* [Adobe XD component](https://xd.adobe.com/view/6430ac9c-eb36-413a-92bf-41d72005dcd4-3163/)
109117
____________________________________________________________
110118

111119
[Edit this page on Github](https://github.com/dxc-technology/halstack-style-guide/blob/master/guidelines/components/card/README.md)
46.5 KB
Loading
23 KB
Loading
46.9 KB
Loading
-15 KB
Loading

0 commit comments

Comments
 (0)