Skip to content

Commit

Permalink
style: fix responsiveness on mobile resolutions
Browse files Browse the repository at this point in the history
  • Loading branch information
Valenreynoso17 committed Jan 25, 2024
1 parent 5feec64 commit e8e2ab2
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.vaadin.flow.component.customfield.CustomField;
import com.vaadin.flow.component.datepicker.DatePicker.DatePickerI18n;
import com.vaadin.flow.component.dependency.CssImport;
import com.vaadin.flow.component.orderedlayout.FlexComponent.JustifyContentMode;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import java.time.DayOfWeek;
import java.util.Arrays;
Expand Down Expand Up @@ -81,6 +82,7 @@ private void setState(boolean state) {
*/
public DayOfWeekSelector() {
getStyle().set("padding", "var(--lumo-space-m)");
getStyle().set("width", "100%");

buttonsLayout = new HorizontalLayout();
buttonsLayout.add(new DayOfWeekButton(DayOfWeek.SUNDAY, "S"));
Expand All @@ -91,6 +93,11 @@ public DayOfWeekSelector() {
buttonsLayout.add(new DayOfWeekButton(DayOfWeek.FRIDAY, "F"));
buttonsLayout.add(new DayOfWeekButton(DayOfWeek.SATURDAY, "S"));

buttonsLayout.setWidthFull();
buttonsLayout.setJustifyContentMode(JustifyContentMode.CENTER);
buttonsLayout.getStyle().set("flex-wrap", "wrap");
buttonsLayout.getStyle().set("padding", "0 10px 0 10px");

getButtons().forEach(button -> button.addClickListener(ev -> updateValue()));
add(buttonsLayout);
clear();
Expand Down

0 comments on commit e8e2ab2

Please sign in to comment.