#22380: "Provide hooks for custom CSS"
¿Sobre qué es este informe?
¿Qué ha pasado? Por favor, selecciona una de las opciones siguientes
Descripción detallada
-
• Por favor explica tu sugerencia de manera precisa y concisa para que sea lo más fácil posible entender lo que quieres decir.
This issue groups a few suggestions, but they're closely related so I think it makes sense to only open one issue.
1. Unless boardgamearena.com/bug?id=13845 is implemented first, please add a high-level id or class "cubirds" so that custom CSS can be targetted to only this game. E.g. you could follow the example of Can't Stop and put a <div id="cubirds"> as a child of #game_play_area wrapping #table_wrap and #myhand_wrap; then rules can be written with selector "#cubirds .stockitem" and not worry about breaking other games.
2. A typical card in the DOM looks like
<div id="table_cards_line_0_item_43" class="stockitem " style="top: 0px; left: 786.5px; width: 60px; height: 80px; background-image: url("x.boardgamearena.net/data/themereleases/current/games/cubirds/200616-1303/img/cubirds_cards.png"); background-position: -600% 0%;"></div>
I can understand putting the top and left positions in inline style, but couldn't the width and height go into the stylesheet under selector .stockitem; and the background-image and background-position go into the stylesheet with selector .card_type_6 etc? Having classes for the different birds would also allow custom CSS to do things like using ::before to add helpful text with the names for those who want that.
3. Similarly for the "play birds" cards at the end of each row: these can probably be targetted by their IDs, but it would be nicer to have a class name by which to target them. I'd quite like to play around with alternative graphics.
4. Slightly off topic, but while I'm on the subject of the "play birds" cards, I don't think they need the background-position. The default position works fine because that sprite isn't a sprite sheet. • ¿Qué navegador estás usando?
Google Chrome v79
Historial de informes
CSS customs isn't possible anymore (temperally or forever)
Thanks for this report, I discovered that there were existing custom CSS in BGA ^^
For the first point, I think this is indeed something more related to the website, so I'll try to raise this to the admins to get feedback.
Regarding the other points (2,3 and 4) :
The card management is done through a standard way at BGA, using a custom library named stock. You can find more on this on BGA's wiki. en.doc.boardgamearena.com/Stock
This library is responsible to manage the cards positioning, animation... and does it the way you describe, using inline styles.
As a game developer, I have no control over it, but I have to say that sizes and background positioning are managed at a single Javascript place, and therefore doing it there instead of letting the devs do it within the css seems to me like a fair choice.
Agregar a este informe
- Otro ID de partida / ID de jugada
- ¿Se resolvió el problema al pulsar F5?
- ¿Apareció el problema varias veces? ¿Cada vez? ¿Aleatoriamente?
- Si tienes una captura de este error (buena práctica), puedes usar Imgur.com para subirla y copiar/pegar el enlace aquí.