Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Umbrella issue for the CSS Support matrix #427

Open
58 of 88 tasks
davesnx opened this issue Mar 7, 2024 · 3 comments
Open
58 of 88 tasks

Umbrella issue for the CSS Support matrix #427

davesnx opened this issue Mar 7, 2024 · 3 comments
Labels
code-generation css-support good first issue Good for newcomers parser Parsing or lexing issues

Comments

@davesnx
Copy link
Owner

davesnx commented Mar 7, 2024

This is the overview of styled-ppx CSS support (as a detailed view of https://styled-ppx.vercel.app/css-support). Currently CSS 3 is almost there, but CSS lately has been adding a bunch of features that we don't support yet, but are simple to add.

Missing properties or values under Parser.re

Our CSS parser fails at parsing this:

Unsupported properties (code-gen)

Parsing works fine, but code-gen for those properties always generates Css.unsafe("property", "value"). So, interpolation doesn't work in those cases and there's risks of introducing errors at runtime while using those properties.

This task (#426) would automatically remove all the effort of going one by one manually

  • Parser.property_image_resolution
  • Parser.property_image_orientation
  • Parser.property_image_rendering
  • Parser.property_border_image_source
  • Parser.property_border_image_slice
  • Parser.property_border_image_width
  • Parser.property_border_image_outset
  • Parser.property_border_image_repeat
  • Parser.property_border_image
  • Parser.property_overflow_clip_margin
  • Parser.property_overflow_inline
  • Parser.property_block_ellipsis
  • Parser.property_max_lines
  • Parser.property_continue
  • Parser.property_tab_size
  • Parser.property_line_break
  • Parser.property_hyphens
  • Parser.property_text_align_all
  • Parser.property_text_align_last
  • Parser.property_text_justify
  • Parser.property_hanging_punctuation
  • Parser.property_font_stretch
  • Parser.property_font_size_adjust
  • Parser.property_font
  • Parser.property_font_synthesis_weight
  • Parser.property_font_synthesis_style
  • Parser.property_font_synthesis_small_caps
  • Parser.property_font_synthesis
  • Parser.property_font_kerning
  • Parser.property_font_variant_ligatures
  • Parser.property_font_variant_position
  • Parser.property_font_variant_caps
  • Parser.property_font_variant_numeric
  • Parser.property_font_variant_alternates
  • Parser.property_font_variant_east_asian
  • Parser.property_font_feature_settings
  • Parser.property_font_optical_sizing
  • Parser.property_font_variation_settings
  • Parser.property_font_palette
  • Parser.property_font_variant_emoji
  • Parser.property_text_decoration_thickness
  • Parser.property_text_underline_position
  • Parser.property_text_underline_offset
  • Parser.property_text_decoration_skip
  • Parser.property_text_decoration_skip_self
  • Parser.property_text_decoration_skip_box
  • Parser.property_text_decoration_skip_inset
  • Parser.property_text_decoration_skip_spaces
  • Parser.property_text_decoration_skip_ink
  • Parser.property_text_emphasis_style
  • Parser.property_text_emphasis_color
  • Parser.property_text_emphasis
  • Parser.property_text_emphasis_position
  • Parser.property_text_emphasis_skip
  • Parser.property_transform_box
  • Parser.property_perspective
  • Parser.property_grid_template

Unsupported values (code-gen)

Some properties don't support a few values and generate the same Css.unsafe code, making it hard for interpolation to work:

  • Parser.property_translate
  • Parser.property_rotate
  • Parser.property_scale
  • Parser.property_transition
  • Parser.property_grid_template_columns
  • Parser.property_grid_template_rows
  • Parser.property_grid_template_areas
  • Parser.property_grid_auto_columns
  • Parser.property_grid_auto_rows
  • Parser.property_grid_auto_flow
  • Parser.property_grid
  • Parser.property_grid_row_start
  • Parser.property_grid_column_start
  • Parser.property_grid_row_end
  • Parser.property_grid_column_end
  • Parser.property_grid_row
  • Parser.property_grid_column
  • Parser.property_grid_area

Missing interpolation

Interpolation would need to be added extensively for all properties that are missing interpolation, it can be a big deal. Currently is configured in most values, so all interpolation should work.

There are rare cases that aren’t implemented, such as recently cursor where the value is very unique to cursor. We should detect this list and add and add a declarations_to_emotion.re function to generate it properly.


The goal of this task is:

@davesnx davesnx added good first issue Good for newcomers parser Parsing or lexing issues code-generation labels Mar 7, 2024
@yokurang
Copy link

yokurang commented Mar 7, 2024

Will give this a go

@davesnx
Copy link
Owner Author

davesnx commented Mar 7, 2024

It's a huge task, so picking one of the unsupported properties is a great start @yokurang or if you prefer improving the parsing is always nice

@davesnx
Copy link
Owner Author

davesnx commented Mar 7, 2024

Feel free to ask me anything in Discord @yokurang: https://discordapp.com/users/122441959414431745

@zakybilfagih zakybilfagih changed the title Umbrella issue for the CSS Support matix Umbrella issue for the CSS Support matrix Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-generation css-support good first issue Good for newcomers parser Parsing or lexing issues
Projects
None yet
Development

No branches or pull requests

2 participants