Coder Social home page Coder Social logo

shopify-sunrise's People

Contributors

fajoaq avatar hujjat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

shopify-sunrise's Issues

Allow user to change breakpoints

๐Ÿ‘‹ Hello again. I am proposing a means to allow the user to define custom breakpoints without having to rely on a custom tailwind config file. This way the end user can pop into the theme editor and change these values at will.

[ My contribution would only move the tailwind breakpoints outside of the tailwind config file (using default values), and the theme author can decide whether they want to provide this functionality ].

Pros

  • End user can change pre-defined breakpoints easily
  • In development, the css is rebuilt automatically when using Shopify Theme Serve with the '--theme-editor-sync' option

Cons

  • Outside of development, must rebuild the css after changing breakpoints through the editor, or [ tailwind ] generated queries will not be updated

How

I have tested this by adding breakpoints to the settings_schema (e.g, 'breakpoint_lg'), and importing the json data into the tailwind config file from 'settings_data'. (optionally, you can simply add these breakpoints to 'settings_data' directly)
tailwind.config.js

const settings = require("./config/settings_data.json").current;
const breakpoints = {
  xl: settings.breakpoint_lg + "px",
  lg: settings.breakpoint_lg + "px",
  md: settings.breakpoint_md + "px",
  sm: settings.breakpoint_sm + "px",
  xs: settings.breakpoint_xs + "px",
};
module.exports = {
  content: [/* paths */],
  theme: {
    screens: {
      xl: breakpoints.lg,
      lg: breakpoints.lg,
      md: breakpoints.md,
      sm: breakpoints.sm,
      xs: breakpoints.xs,
    },
  },
};

Of course, you can continue to use tailwind breakpoints, but I wouldn't. My solution is to not use tailwind breakpoints (e.g, md:p-0) wherever possible, and use the settings values directly instead via {% style %} tags. I took this approach because I was having zero luck getting css vars to work inside the config file.

This is purely optional, tailwind breakpoints will continue to work as intended. I think it's worth it to allow the user to change these values as needed. What do you think?

Cheers

Edit; I've noted that while you work on the theme settings schema, you'll want to use Shopify Theme Serve without the sync option (or whatever is equivalent)

img_src is deprecated

Hello buddy, I'm working on my theme and noticing quite a few linting warnings. One of which is that 'img_src' is deprecated. It still works, but the new way to do it is "section.settings.image | image_src: width: 'string', height: 'string'". Only one dimension is required.

There are quite a few instances, I understand if you're too busy to update. If you like, I can do a PR. Cheers

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.