@@ -216,6 +216,9 @@ class GridItemCardDirective(SphinxDirective):
216
216
"columns" : item_columns_option ,
217
217
"margin" : margin_option ,
218
218
"padding" : padding_option ,
219
+ "class-item" : directives .class_option ,
220
+ # The options below must be sync'ed with CardDirective.option_spec (minus margin).
221
+ "width" : make_choice (["auto" , "25%" , "50%" , "75%" , "100%" ]),
219
222
"text-align" : text_align ,
220
223
"img-background" : directives .uri ,
221
224
"img-top" : directives .uri ,
@@ -224,12 +227,13 @@ class GridItemCardDirective(SphinxDirective):
224
227
"link-type" : make_choice (["url" , "any" , "ref" , "doc" ]),
225
228
"link-alt" : directives .unchanged ,
226
229
"shadow" : make_choice (["none" , "sm" , "md" , "lg" ]),
227
- "class-item" : directives .class_option ,
228
230
"class-card" : directives .class_option ,
229
231
"class-body" : directives .class_option ,
230
232
"class-title" : directives .class_option ,
231
233
"class-header" : directives .class_option ,
232
234
"class-footer" : directives .class_option ,
235
+ "class-img-top" : directives .class_option ,
236
+ "class-img-bottom" : directives .class_option ,
233
237
}
234
238
235
239
def run (self ) -> List [nodes .Node ]:
@@ -257,6 +261,7 @@ def run(self) -> List[nodes.Node]:
257
261
for key , value in self .options .items ()
258
262
if key
259
263
in [
264
+ "width" ,
260
265
"text-align" ,
261
266
"img-background" ,
262
267
"img-top" ,
@@ -270,9 +275,12 @@ def run(self) -> List[nodes.Node]:
270
275
"class-title" ,
271
276
"class-header" ,
272
277
"class-footer" ,
278
+ "class-img-top" ,
279
+ "class-img-bottom" ,
273
280
]
274
281
}
275
- card_options ["width" ] = "100%"
282
+ if "width" not in card_options :
283
+ card_options ["width" ] = "100%"
276
284
card_options ["margin" ] = []
277
285
card = CardDirective .create_card (self , self .arguments , card_options )
278
286
column += card
0 commit comments